Class ExternalMap

All Implemented Interfaces:
JepComponent, PostfixMathCommandI, Serializable

public class ExternalMap extends UnaryFunction implements JepComponent

Turns a unary function taking scalar arguments into a function that takes a list and returns a list with function applied to each element. For the scalar functions sqrt(x) given a list [a,b,c] calculates [sqrt(a),sqrt(b),sqrt(c)]. See StreamExternalMap for the Stream version of this function.

Since:
Jep 4.1, extensions 2.2
See Also:
  • Constructor Details

  • Method Details

    • eval

      public Object eval(Object arg) throws EvaluationException
      Description copied from class: UnaryFunction
      Evaluate the function
      Specified by:
      eval in class UnaryFunction
      Parameters:
      arg - the single argument passed in
      Returns:
      the result of the function
      Throws:
      EvaluationException - on error
    • init

      public void init(Jep jep)
      Description copied from interface: JepComponent
      Initialize the component. This method is called whenever a component is added to Jep. Hence, it allows components to keep track of the other components they may rely on.
      Specified by:
      init in interface JepComponent
      Parameters:
      jep - the current Jep instance
    • getLightWeightInstance

      public JepComponent getLightWeightInstance()
      Description copied from interface: JepComponent
      Gets a light-weight instance suitable for using in multiple threads.
      Specified by:
      getLightWeightInstance in interface JepComponent
      Returns:
      either a new instance, null or 'this'.
    • getInner

      public Object getInner()