org.apache.commons.functor.generator
Class TransformedGenerator<I,E>

java.lang.Object
  extended by org.apache.commons.functor.generator.BaseGenerator<E>
      extended by org.apache.commons.functor.generator.TransformedGenerator<I,E>
All Implemented Interfaces:
Generator<E>

public class TransformedGenerator<I,E>
extends BaseGenerator<E>

Generator that transforms the elements of another Generator.

Version:
$Revision: 1156799 $ $Date: 2011-08-11 22:11:54 +0200 (Thu, 11 Aug 2011) $

Constructor Summary
TransformedGenerator(Generator<? extends I> wrapped, UnaryFunction<? super I,? extends E> func)
          Create a new TransformedGenerator.
 
Method Summary
 boolean equals(Object obj)
          
protected  Generator<? extends I> getWrappedGenerator()
          Get the generator that is being wrapped.
 int hashCode()
          
 void run(UnaryProcedure<? super E> proc)
          Generators must implement this method.
 
Methods inherited from class org.apache.commons.functor.generator.BaseGenerator
isStopped, stop, to, to, toCollection
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

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

getWrappedGenerator

protected Generator<? extends I> 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


Copyright © 2003-2011 The Apache Software Foundation. All Rights Reserved.