E
- the type of elements held in this generator.public interface Generator<E>
Modifier and Type | Method and Description |
---|---|
void |
run(Procedure<? super E> proc)
Generators must implement this method.
|
<C extends Collection<? super E>> |
to(C collection)
Same as to(new CollectionTransformer(collection)).
|
<Z> Z |
to(Function<Generator<? extends E>,? extends Z> transformer)
Transforms this generator using the passed in
transformer.
|
Collection<? super E> |
toCollection()
Same as to(new CollectionTransformer()).
|
void run(Procedure<? super E> proc)
proc
- Procedure to run<Z> Z to(Function<Generator<? extends E>,? extends Z> transformer)
Collection
of elements.Z
- the returned value type of the input Function
transformer
- Function to apply to this<C extends Collection<? super E>> C to(C collection)
C
- the returned collection typecollection
- Collection to which my elements should be addedcollection
Collection<? super E> toCollection()
Copyright © 2003–2014 The Apache Software Foundation. All rights reserved.