Class OperationChain
java.lang.Object
me.datafox.dfxengine.values.operation.OperationChain
- All Implemented Interfaces:
BiFunction<Numeral,,Numeral[], Numeral> Operation
An
Operation that chains multiple operations together. The operations are executed in order, with the
previous one's output as the next one's input. Parameters are given in order, with the total parameter count being
the sum of all parameter counts of the specified operations. A simple OperationChain.Builder that works with method
references is included for convenience.-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.function.BiFunction
andThenMethods inherited from interface me.datafox.dfxengine.values.api.operation.Operation
getParameterCount
-
Constructor Details
-
OperationChain
- Parameters:
operations-Operationsfor this operation
-
-
Method Details
-
apply
- Specified by:
applyin interfaceBiFunction<Numeral,Numeral[], Numeral> - Specified by:
applyin interfaceOperation- Parameters:
source- sourceNumeralfor this operationparameters- parameterNumeralsfor this operation- Returns:
- resulting
Numeralof this operation - Throws:
IllegalArgumentException- if the amount of parameters is not equal toOperation.getParameterCount()
-
builder
- Returns:
OperationChain.Builderinstance
-