Class StreamTerminalFunction

All Implemented Interfaces:
JepComponent, PostfixMathCommandI, Serializable

public class StreamTerminalFunction extends UnaryFunction implements JepComponent
A terminal function that takes a Stream as its single argument, takes all elements from the stream and passes them as arguments to the inner functions.
See Also:
  • Constructor Details

    • StreamTerminalFunction

      public StreamTerminalFunction(PostfixMathCommand inner)
      Constructor wrapping any PFMC.
      Parameters:
      inner - the PFMC used to process the arguments
  • 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'.
    • getDescription

      public String getDescription()
      Description copied from class: PostfixMathCommand
      Return a description of the function from the properties file. The property name is the class name followed by ".description". The property is found using the JepMessages class, which can be configured to add additional properties files. If PostfixMathCommand.setDescription(String) has been called, return the description set by that method instead.
      Specified by:
      getDescription in interface PostfixMathCommandI
      Overrides:
      getDescription in class PostfixMathCommand
      Returns:
      the description of the function