Class FilteredGenerator<E>
java.lang.Object
org.apache.commons.functor.generator.BaseGenerator<E>
org.apache.commons.functor.generator.FilteredGenerator<E>
- Type Parameters:
E- the type of elements held in this generator.
- All Implemented Interfaces:
Generator<E>
Generator that filters another Generator by only passing through those elements
that are matched by a specified UnaryPredicate.
- Version:
- $Revision$ $Date$
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFilteredGenerator(Generator<? extends E> wrapped, UnaryPredicate<? super E> pred) Create a new FilteredGenerator. -
Method Summary
Modifier and TypeMethodDescriptionbooleanGet the generator that is being wrapped.inthashCode()voidrun(UnaryProcedure<? super E> proc) Generators must implement this method.Methods inherited from class BaseGenerator
isStopped, stop, to, to, toCollection
-
Field Details
-
pred
The wrapped generator.
-
-
Constructor Details
-
FilteredGenerator
Create a new FilteredGenerator.- Parameters:
wrapped- Generator to wrappred- filtering UnaryPredicate
-
-
Method Details
-
run
Generators must implement this method.- Parameters:
proc- UnaryProcedure to run
-
getWrappedGenerator
Get the generator that is being wrapped.- Overrides:
getWrappedGeneratorin classBaseGenerator<E>- Returns:
- Generator
-
equals
-
hashCode
-