Class ArrayFunctionBase

java.lang.Object
com.singularsys.jep.functions.PostfixMathCommand
com.singularsys.jep.functions.ArrayFunctionBase
All Implemented Interfaces:
ZeroLengthBehaviourI, PostfixMathCommandI, Serializable
Direct Known Subclasses:
Average, BigDecVSum, ElementOf, MinMax, VSum

public abstract class ArrayFunctionBase extends PostfixMathCommand implements ZeroLengthBehaviourI
Base class for functions that operate on arrays such as Average, MinMax, and VSum. The shared functionality such as array flattening is implemented here. In the run() method, before calling calc(), Vectors and nested Vectors are flattened so 1,[2,[3, 4]] becomes [1, 2, 3, 4] which is passed in to the calc method as a List<Object>.
Since:
3.4.0
See Also:
  • Constructor Details

    • ArrayFunctionBase

      public ArrayFunctionBase()
      Default the number of parameters to any number of params (-1).
    • ArrayFunctionBase

      protected ArrayFunctionBase(ZeroLengthBehaviourI.ZeroLengthErrorBehaviour zeroLengthErrorBehaviour)
      Constructor with a specified zero length error behaviour.
      Parameters:
      zeroLengthErrorBehaviour -
    • ArrayFunctionBase

      protected ArrayFunctionBase(Object zeroLengthValue)
      Constructor with a specified value to return for zero length arrays. Sets the zero length error behaviour to VALUE.
      Parameters:
      zeroLengthValue - the value to return when a zero length array is passed
  • Method Details