Package org.eolang

Class ExprReduce.Args<T>

  • Type Parameters:
    T - Type of arguments that are going to be reduced
    Enclosing class:
    ExprReduce<T>

    public static final class ExprReduce.Args<T>
    extends Object
    Extracts and validates args.
    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> args = new Args<>(
             "plus",
             Long.class,
             Long::sum,
             x -> ""
    
         );
     
    Since:
    1.0
    • Constructor Detail

      • Args

        public Args​(Class<T> type,
                    Function<T,​String> validation,
                    String oper)
        Ctor.
        Parameters:
        type - Type of parameter with varargs
        validation - Validation operation on varargs
        oper - Operation that that should be used with varargs
    • Method Detail

      • get

        public List<T> get​(Phi rho,
                           String param)
        Ctor.
        Parameters:
        rho - Rho argument that is parsed
        param - Name of parameter with varargs
        Returns:
        Returns the list of parsed and validated values