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$ $Date$
  • Field Details

    • toFill

      private final Collection<? super E> toFill
      The adapted collection has to be filled.
  • Constructor Details

    • CollectionTransformer

      public CollectionTransformer()
      Create a new CollectionTransformer.
    • CollectionTransformer

      public CollectionTransformer(Collection<? super E> toFill)
      Create a new CollectionTransformer.
      Parameters:
      toFill - Collection to fill
  • Method Details