Class ChainedDefine
java.lang.Object
com.singularsys.jep.functions.PostfixMathCommand
com.singularsys.jep.functions.NaryFunction
com.singularsys.extensions.lambda.Define
com.singularsys.extensions.chained.ChainedDefine
- All Implemented Interfaces:
JepComponent,PostfixMathCommandI,Serializable
An extension to the
* An optional fourth parameter is a comma separated list of options.
Define function that allows
chained functions to be created.
Node node = jep.parse("define('sq',seq=>seq.map(x=>x^2),'square a sequence','Function,Chained');");
Object res = jep.evaluate(node);
jep.reinitializeComponents();
node = jep.parse("[1..5] . sq()");
res = jep.evaluate(node);
Chainedthe function is a chained functionseq . fun(arg)Chainablethe function is a chainable function evaluated asseq . fun(arg), orfun(arg,seq)BinarySwappedthe function is a binary function with arguments swapped in a chained contextfun(seq,arg)orseq . fun(arg)
- Since:
- 4.1
- 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 TypeMethodDescriptionprotected voidbuildFunctionFromOptions(String ls, LambdaFunction pfmc, String options) Gets a light-weight instance suitable for using in multiple threads.Methods inherited from class com.singularsys.extensions.lambda.Define
buildOperatorFromOptions, checkNumberOfParameters, eval, getFlags, getOperatorProp, getProp, initMethods inherited from class com.singularsys.jep.functions.NaryFunction
runMethods inherited from class com.singularsys.jep.functions.PostfixMathCommand
asArray, asBool, asDouble, asInt, asLong, asStrictInt, asString, asType, getDescription, getDescription, getDescriptionWithType, getName, getNumberOfParameters, setCurNumberOfParameters, setDescription, setName, toString, toString
-
Constructor Details
-
ChainedDefine
public ChainedDefine()
-
-
Method Details
-
buildFunctionFromOptions
- Overrides:
buildFunctionFromOptionsin classDefine
-
getLightWeightInstance
Description copied from interface:JepComponentGets a light-weight instance suitable for using in multiple threads.- Specified by:
getLightWeightInstancein interfaceJepComponent- Overrides:
getLightWeightInstancein classDefine- Returns:
- either a new instance, null or 'this'.
-