Class UntilGenerate<E>
java.lang.Object
org.apache.commons.functor.generator.BaseGenerator<E>
org.apache.commons.functor.generator.UntilGenerate<E>
- Type Parameters:
E- the type of elements held in this generator.
- All Implemented Interfaces:
Generator<E>
Wrap another
Generator such that run(UnaryProcedure) terminates once
a condition has been satisfied.- Version:
- $Revision$ $Date$
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final UnaryPredicate<? super E> The condition has to verified in order to execute the generation. -
Constructor Summary
ConstructorsConstructorDescriptionUntilGenerate(UnaryPredicate<? super E> test, Generator<? extends E> wrapped) Create a new UntilGenerate. -
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
-
test
The condition has to verified in order to execute the generation.
-
-
Constructor Details
-
UntilGenerate
Create a new UntilGenerate.- Parameters:
test-UnaryPredicatewrapped-Generator
-
-
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
-