Class FormulaEvaluatorUtil.FunctionWithListAsArgumentHelper<E>

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract E getFallBackValue()
      Returns the value this function defaults to if an empty list or null is given as an argument.
      abstract E getPreliminaryResult​(E currentResult, E nextValue)
      Calculates a preliminary result based on the current result and the next value in the list.
      E getResult​(java.util.List<E> listOfValues)
      Returns the result of this function given a list of values.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FunctionWithListAsArgumentHelper

        public FunctionWithListAsArgumentHelper()
    • Method Detail

      • getResult

        public E getResult​(java.util.List<E> listOfValues)
        Returns the result of this function given a list of values.
        Parameters:
        listOfValues - A List of values.
      • getFallBackValue

        public abstract E getFallBackValue()
        Returns the value this function defaults to if an empty list or null is given as an argument. E.g. for the function sum, the fall back value is 0.
      • getPreliminaryResult

        public abstract E getPreliminaryResult​(E currentResult,
                                               E nextValue)
        Calculates a preliminary result based on the current result and the next value in the list.
        Parameters:
        currentResult - The current result calculated up to this point.
        nextValue - The value to be considered next.
        Returns:
        The result of the operation defined by subclasses.