Class GenerateWhile<E>

  • Type Parameters:
    E - the type of elements held in this generator.
    All Implemented Interfaces:
    Generator<E>

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

      • test

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

      • run

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

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object