groovyx.gpars.dataflow.operator
Class FilterClosure<V>

java.lang.Object
  extended by groovy.lang.GroovyObjectSupport
      extended by groovy.lang.Closure
          extended by groovyx.gpars.dataflow.operator.FilterClosure<V>
All Implemented Interfaces:
groovy.lang.GroovyCallable, groovy.lang.GroovyObject, java.io.Serializable, java.lang.Cloneable, java.lang.Runnable, java.util.concurrent.Callable

public final class FilterClosure<V>
extends groovy.lang.Closure

Used by the filter() method to wrap the supplied closure and use it for filtering data. This wrapper closure returns the original data, if the supplied function returns true. A NullObject.getNullObject() value is return to indicate the current piece of data should be filtered out.

Author:
Vaclav Pech
See Also:
Serialized Form

Field Summary
private static java.lang.Class[] PARAMETER_TYPES
           
private  groovy.lang.Closure<java.lang.Boolean> wiseMan
           
 
Fields inherited from class groovy.lang.Closure
DELEGATE_FIRST, DELEGATE_ONLY, DONE, IDENTITY, maximumNumberOfParameters, OWNER_FIRST, OWNER_ONLY, parameterTypes, SKIP, TO_SELF
 
Constructor Summary
FilterClosure(groovy.lang.Closure<java.lang.Boolean> wiseMan)
           
 
Method Summary
 java.lang.Object call()
           
 java.lang.Object call(java.lang.Object... args)
           
 java.lang.Object call(java.lang.Object arguments)
           
 int getMaximumNumberOfParameters()
           
 java.lang.Class[] getParameterTypes()
           
 
Methods inherited from class groovy.lang.Closure
asWritable, clone, curry, curry, dehydrate, getDelegate, getDirective, getOwner, getProperty, getResolveStrategy, getThisObject, isCase, leftShift, leftShift, memoize, memoizeAtLeast, memoizeAtMost, memoizeBetween, ncurry, ncurry, rcurry, rcurry, rehydrate, rightShift, run, setDelegate, setDirective, setProperty, setResolveStrategy, throwRuntimeException, trampoline, trampoline
 
Methods inherited from class groovy.lang.GroovyObjectSupport
getMetaClass, invokeMethod, setMetaClass
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

wiseMan

private final groovy.lang.Closure<java.lang.Boolean> wiseMan

PARAMETER_TYPES

private static final java.lang.Class[] PARAMETER_TYPES
Constructor Detail

FilterClosure

public FilterClosure(groovy.lang.Closure<java.lang.Boolean> wiseMan)
Method Detail

getMaximumNumberOfParameters

public int getMaximumNumberOfParameters()
Overrides:
getMaximumNumberOfParameters in class groovy.lang.Closure

getParameterTypes

public java.lang.Class[] getParameterTypes()
Overrides:
getParameterTypes in class groovy.lang.Closure

call

public java.lang.Object call(java.lang.Object arguments)
Overrides:
call in class groovy.lang.Closure

call

public java.lang.Object call(java.lang.Object... args)
Overrides:
call in class groovy.lang.Closure

call

public java.lang.Object call()
Specified by:
call in interface java.util.concurrent.Callable
Overrides:
call in class groovy.lang.Closure

Copyright © 2008–2012 Václav Pech. All Rights Reserved.