Class StreamSendToStream
java.lang.Object
com.singularsys.jep.functions.PostfixMathCommand
com.singularsys.extensions.stream.StreamSendToStream
- All Implemented Interfaces:
CallbackEvaluationI,JepComponent,PostfixMathCommandI,Serializable
public class StreamSendToStream
extends PostfixMathCommand
implements CallbackEvaluationI, JepComponent
An assignment operator allowing unclosed steams to be saved to a variable.
For example
The variable can only be used once.
[1..50] . map(x=>x^2) --> s
s . filter(x=> x%2==0)
This function is not included in StreamOperatorTable
it can be added with
ot.insertOperator(
new Operator("-->",
new StreamSendToStream(),
Operator.BINARY+Operator.LEFT),
ot.getAssign());
- Since:
- Jep 4.1 extensions 2.2
- See Also:
-
Field Summary
Fields inherited from class com.singularsys.jep.functions.PostfixMathCommand
curNumberOfParameters, description, name, NaN, numberOfParameters -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionEvaluate the operator.Gets a light-weight instance suitable for using in multiple threads.voidInitialize the component.Methods inherited from class com.singularsys.jep.functions.PostfixMathCommand
asArray, asBool, asDouble, asInt, asLong, asStrictInt, asString, asType, checkNumberOfParameters, getDescription, getDescription, getDescriptionWithType, getName, getNumberOfParameters, run, setCurNumberOfParameters, setDescription, setName, toString, toString
-
Constructor Details
-
StreamSendToStream
public StreamSendToStream()
-
-
Method Details
-
evaluate
Evaluate the operator. The left hand child node is evaluated, theVariableorLValueIon the right hand is then set to this value. As a stream can only be used once the function returns zero.- Specified by:
evaluatein interfaceCallbackEvaluationI- Parameters:
node- tree to evaluatepv- the evaluator- Returns:
- Zero.
- Throws:
EvaluationException- if the calculation cannot be performed- See Also:
-
init
Description copied from interface:JepComponentInitialize 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:
initin interfaceJepComponent- Parameters:
jep- the current Jep instance
-
getLightWeightInstance
Description copied from interface:JepComponentGets a light-weight instance suitable for using in multiple threads.- Specified by:
getLightWeightInstancein interfaceJepComponent- Returns:
- either a new instance, null or 'this'.
-