Class 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>

    public class TransformedGenerator<I,​E>
    extends BaseGenerator<E>
    Generator that transforms the elements of another Generator.
    Version:
    $Revision$ $Date$
    • Field Detail

      • func

        private final UnaryFunction<? super I,​? extends E> func
        The UnaryFunction to apply to each element.
    • Constructor Detail

      • TransformedGenerator

        public TransformedGenerator​(Generator<? extends I> wrapped,
                                    UnaryFunction<? super I,​? extends E> func)
        Create a new TransformedGenerator.
        Parameters:
        wrapped - Generator to transform
        func - UnaryFunction to apply to each element
    • 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