Class TransformedGenerator<I,E>
java.lang.Object
org.apache.commons.functor.generator.BaseGenerator<E>
org.apache.commons.functor.generator.TransformedGenerator<I,E>
- Type Parameters:
I- the type of elements held in the wrapped generator.E- the type of elements held in this generator.
- All Implemented Interfaces:
Generator<E>
Generator that transforms the elements of another Generator.
- Version:
- $Revision$ $Date$
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final UnaryFunction<? super I, ? extends E> The UnaryFunction to apply to each element. -
Constructor Summary
ConstructorsConstructorDescriptionTransformedGenerator(Generator<? extends I> wrapped, UnaryFunction<? super I, ? extends E> func) Create a new TransformedGenerator. -
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
-
func
The UnaryFunction to apply to each element.
-
-
Constructor Details
-
TransformedGenerator
public TransformedGenerator(Generator<? extends I> wrapped, UnaryFunction<? super I, ? extends E> func) Create a new TransformedGenerator.- Parameters:
wrapped- Generator to transformfunc- UnaryFunction to apply to each element
-
-
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
-