Class WhileGenerate<E>

java.lang.Object
org.apache.commons.functor.generator.BaseGenerator<E>
org.apache.commons.functor.generator.WhileGenerate<E>
Type Parameters:
E - the type of elements held in this generator.
All Implemented Interfaces:
Generator<E>

public class WhileGenerate<E> extends BaseGenerator<E>
Wrap another Generator such that run(UnaryProcedure) continues as long as a condition is true (test before).
Version:
$Revision$ $Date$
  • Field Details

    • test

      private final UnaryPredicate<? super E> test
      The condition has to verified in order to execute the generation.
  • Constructor Details

  • Method Details

    • run

      public void run(UnaryProcedure<? super E> proc)
      Generators must implement this method.
      Parameters:
      proc - UnaryProcedure to run
    • getWrappedGenerator

      protected Generator<? extends E> getWrappedGenerator()
      Get the generator that is being wrapped.
      Overrides:
      getWrappedGenerator in class BaseGenerator<E>
      Returns:
      Generator
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object