org.apache.commons.functor.generator.util
Class CollectionTransformer<E>
java.lang.Object
org.apache.commons.functor.generator.util.CollectionTransformer<E>
- Type Parameters:
E
- the type of elements held in the adapted collection.
- All Implemented Interfaces:
- Functor, UnaryFunction<Generator<? extends E>,Collection<? super E>>, UnaryFunctor<Generator<? extends E>>
public class CollectionTransformer<E>
- extends Object
- implements UnaryFunction<Generator<? extends E>,Collection<? super E>>
Transforms a generator into a collection. If a collection is not passed into
the constructor an ArrayList will be returned from the transform method.
- Since:
- 1.0
- Version:
- $Revision: 1160793 $ $Date: 2011-08-23 18:48:32 +0200 (Tue, 23 Aug 2011) $
- Author:
- Jason Horman (jason@jhorman.org)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CollectionTransformer
public CollectionTransformer()
- Create a new CollectionTransformer.
CollectionTransformer
public CollectionTransformer(Collection<? super E> toFill)
- Create a new CollectionTransformer.
- Parameters:
toFill
- Collection to fill
evaluate
public Collection<E> evaluate(Generator<? extends E> generator)
- Evaluate this function.
- Specified by:
evaluate
in interface UnaryFunction<Generator<? extends E>,Collection<? super E>>
- Parameters:
generator
- the A object to evaluate
- Returns:
- the T result of this evaluation
Copyright © 2003-2011 The Apache Software Foundation. All Rights Reserved.