Class StreamAppend

All Implemented Interfaces:
JepComponent, PostfixMathCommandI, Serializable

public class StreamAppend extends BinaryFunction implements JepComponent
Concatenates two streams into a single stream. Returns a new list.
[1,2,3] . append([4,5]) -> [1,2,3,4,5]
[1,2,3,4] . append(5) -> [1,2,3,4,5]
or in function form
append([1,2,3], [4,5]) -> [1,2,3,4,5]
append([1,2,3,4], 5) -> [1,2,3,4,5]
note the arguments are swapped in the chained form, producing a more natural reading order.
See Also:
  • Constructor Details

    • StreamAppend

      public StreamAppend()
  • Method Details

    • eval

      public Object eval(Object l, Object r) throws EvaluationException
      Description copied from class: BinaryFunction
      Evaluate the function
      Specified by:
      eval in class BinaryFunction
      Parameters:
      l - lhs argument
      r - rhs argument
      Returns:
      the results
      Throws:
      EvaluationException - if the function cannot be evaluated.
    • 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'.