Package | Description |
---|---|
org.apache.commons.functor.core.algorithm |
Various algorithm-esque functors.
|
org.apache.commons.functor.generator |
Contains code related to Generators.
|
org.apache.commons.functor.generator.loop |
Contains code related to Generators that control execution flow.
|
org.apache.commons.functor.generator.util |
Contains utility code for Generators.
|
Modifier and Type | Method and Description |
---|---|
E |
FindWithinGenerator.evaluate(Generator<? extends E> left,
Predicate<? super E> right)
Evaluate this function.
|
T |
FoldRight.evaluate(Generator<T> obj)
Evaluate this function.
|
T |
FoldLeft.evaluate(Generator<T> obj)
Evaluate this function.
|
T |
FoldRight.evaluate(Generator<T> left,
T right)
Evaluate this function.
|
T |
FoldLeft.evaluate(Generator<T> left,
T right)
Evaluate this function.
|
boolean |
GeneratorContains.test(Generator<? extends T> left,
Predicate<? super T> right)
Evaluate this predicate.
|
Modifier and Type | Class and Description |
---|---|
class |
BaseGenerator<E>
Base class for generators.
|
class |
FilteredGenerator<E>
Generator that filters another Generator by only passing through those elements
that are matched by a specified Predicate.
|
Modifier and Type | Method and Description |
---|---|
protected Generator<? extends E> |
FilteredGenerator.getWrappedGenerator()
Get the generator that is being wrapped.
|
Modifier and Type | Method and Description |
---|---|
<T> T |
BaseGenerator.to(Function<Generator<? extends E>,? extends T> transformer)
Transforms this generator using the passed in
transformer.
|
<Z> Z |
Generator.to(Function<Generator<? extends E>,? extends Z> transformer)
Transforms this generator using the passed in
transformer.
|
Constructor and Description |
---|
FilteredGenerator(Generator<? extends E> wrapped,
Predicate<? super E> pred)
Create a new FilteredGenerator.
|
Modifier and Type | Class and Description |
---|---|
class |
GenerateUntil<E>
Wrap another
Generator such that GenerateUntil.run(Procedure) terminates once
a condition has been satisfied (test after). |
class |
GenerateWhile<E>
Wrap another
Generator such that GenerateWhile.run(Procedure) continues
as long as a condition is true (test after). |
class |
IteratorToGeneratorAdapter<E>
Adapts an
Iterator to the LoopGenerator interface. |
class |
LoopGenerator<E>
Base class for generators that control execution flow, and may need to
stop the generation.
|
class |
TransformedGenerator<I,E>
Generator that transforms the elements of another Generator.
|
class |
UntilGenerate<E>
Wrap another
Generator such that UntilGenerate.run(Procedure) terminates once
a condition has been satisfied. |
class |
WhileGenerate<E>
Wrap another
Generator such that WhileGenerate.run(Procedure) continues
as long as a condition is true (test before). |
Modifier and Type | Method and Description |
---|---|
protected Generator<? extends E> |
LoopGenerator.getWrappedGenerator()
Get the generator that is being wrapped.
|
Constructor and Description |
---|
GenerateUntil(Generator<? extends E> wrapped,
Predicate<? super E> test)
Create a new GenerateUntil.
|
GenerateWhile(Generator<? extends E> wrapped,
Predicate<? super E> test)
Create a new GenerateWhile.
|
LoopGenerator(Generator<? extends E> generator)
A generator can wrap another generator.
|
TransformedGenerator(Generator<? extends I> wrapped,
Function<? super I,? extends E> func)
Create a new TransformedGenerator.
|
UntilGenerate(Predicate<? super E> test,
Generator<? extends E> wrapped)
Create a new UntilGenerate.
|
WhileGenerate(Predicate<? super E> test,
Generator<? extends E> wrapped)
Create a new WhileGenerate.
|
Modifier and Type | Method and Description |
---|---|
static <E> Generator<E> |
EachElement.from(E... array)
Get a Generator for each element of an Object[].
|
static <E> Generator<E> |
EachElement.from(Iterable<? extends E> iterable)
Get a Generator for each element of an Iterable.
|
static <E> Generator<E> |
EachElement.from(Iterator<? extends E> iter)
Get a Generator for each element of an Iterator.
|
static <K,V> Generator<Map.Entry<K,V>> |
EachElement.from(Map<? extends K,? extends V> map)
Get a Generator for each entry of a Map.
|
Modifier and Type | Method and Description |
---|---|
C |
CollectionTransformer.evaluate(Generator<? extends E> generator)
Run the
Generator adding each element produced into the
collection. |
Copyright © 2003–2014 The Apache Software Foundation. All rights reserved.