Class FoldLeft.FoldLeftHelper<T>
- java.lang.Object
-
- org.apache.commons.functor.core.algorithm.FoldLeft.FoldLeftHelper<T>
-
- Type Parameters:
T- the returned evaluation type.
- All Implemented Interfaces:
Functor,UnaryFunctor<T>,UnaryProcedure<T>
private static class FoldLeft.FoldLeftHelper<T> extends java.lang.Object implements UnaryProcedure<T>
Helper procedure.
-
-
Constructor Summary
Constructors Constructor Description FoldLeftHelper(BinaryFunction<? super T,? super T,? extends T> function)Create a seedless FoldLeftHelper.FoldLeftHelper(T seed, BinaryFunction<? super T,? super T,? extends T> function)Create a new FoldLeftHelper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) TgetResult()Get current result.voidrun(T obj)Execute this procedure.
-
-
-
Field Detail
-
function
private final BinaryFunction<? super T,? super T,? extends T> function
The wrapped function.
-
seed
private T seed
The seed object.
-
started
private boolean started
Flag to check the helper started or not.
-
-
Constructor Detail
-
FoldLeftHelper
public FoldLeftHelper(BinaryFunction<? super T,? super T,? extends T> function)
Create a seedless FoldLeftHelper.- Parameters:
function- The wrapped function
-
FoldLeftHelper
FoldLeftHelper(T seed, BinaryFunction<? super T,? super T,? extends T> function)
Create a new FoldLeftHelper.- Parameters:
seed- initial left-side argumentfunction- The wrapped function
-
-
Method Detail
-
run
public void run(T obj)
Execute this procedure.- Specified by:
runin interfaceUnaryProcedure<T>- Parameters:
obj- an A parameter to this execution
-
getResult
T getResult()
Get current result.- Returns:
- Object
-
-