Class FoldRight.FoldRightHelper<T>
java.lang.Object
org.apache.commons.functor.core.algorithm.FoldRight.FoldRightHelper<T>
- Type Parameters:
T- the returned evaluation type.
- All Implemented Interfaces:
Functor, UnaryFunctor<T>, UnaryProcedure<T>
Helper class.
- Version:
- $Revision$ $Date$
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final BinaryFunction<? super T, ? super T, ? extends T> The wrapped function.private final booleanFlag to check the helper started or not.private final TThe seed object.The stack where storing the wrapped function evaluations. -
Constructor Summary
ConstructorsConstructorDescriptionFoldRightHelper(BinaryFunction<? super T, ? super T, ? extends T> function) Create a seedless FoldRightHelper.FoldRightHelper(T seed, BinaryFunction<? super T, ? super T, ? extends T> function) Create a new FoldRightHelper. -
Method Summary
-
Field Details
-
stk
-
function
The wrapped function. -
seed
The seed object. -
hasSeed
private final boolean hasSeedFlag to check the helper started or not.
-
-
Constructor Details
-
FoldRightHelper
Create a seedless FoldRightHelper.- Parameters:
function- The wrapped function
-
FoldRightHelper
FoldRightHelper(T seed, BinaryFunction<? super T, ? super T, ? extends T> function) Create a new FoldRightHelper.- Parameters:
seed- initial right-side argumentfunction- The wrapped function
-
-
Method Details
-
run
Execute this procedure.- Specified by:
runin interfaceUnaryProcedure<T>- Parameters:
obj- an A parameter to this execution
-
getResult
-