Package org.eolang
Class ExprReduce<T>
- java.lang.Object
-
- org.eolang.ExprReduce<T>
-
- Type Parameters:
T
- Type of arguments
- All Implemented Interfaces:
Expr
public final class ExprReduce<T> extends Object implements Expr
Builds a phi performing reduction operation on varargs parameter.
The expression iterates over varargs (including rho) one by one performing provided reduction operation. Type checking is done for each vararg. Definition example:final VarargExpr<Long> expr = new VarargExpr<>( "plus", "x", Long.class, Long::sum, );
- Since:
- 1.0
-
-
Constructor Detail
-
ExprReduce
public ExprReduce(String oper, String param, Class<T> type, BiFunction<T,T,T> reduction, Function<T,String> validation)
Ctor.- Parameters:
oper
- Operation nameparam
- Name of parameter with varargstype
- Type of varargsreduction
- Reduction operation on consecutive varagsvalidation
- Validation function
-
-