Class Merge
- java.lang.Object
-
- com.singularsys.jep.functions.PostfixMathCommand
-
- com.singularsys.jep.functions.NaryFunction
-
- com.singularsys.extensions.lambda.Merge
-
- All Implemented Interfaces:
JepComponent,PostfixMathCommandI,java.io.Serializable
public class Merge extends NaryFunction implements JepComponent
Joins two sequences together, element by element. Returns a list which is the shorter of the two lists.merge([x,y]=>x*y,[1,2,3,4,5],[2,2,2,2,2])
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.singularsys.jep.functions.PostfixMathCommand
curNumberOfParameters, name, NaN, numberOfParameters
-
-
Constructor Summary
Constructors Constructor Description Merge()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objecteval(java.lang.Object[] args)Evaluate the functionJepComponentgetLightWeightInstance()Gets a light-weight instance suitable for using in multiple threads.voidinit(Jep jep)Initialize the component.-
Methods inherited from class com.singularsys.jep.functions.NaryFunction
run
-
Methods inherited from class com.singularsys.jep.functions.PostfixMathCommand
asArray, asBool, asDouble, asInt, asLong, asStrictInt, asString, checkNumberOfParameters, getName, getNumberOfParameters, setCurNumberOfParameters, setName, toString, toString
-
-
-
-
Method Detail
-
init
public void init(Jep jep)
Description copied from interface:JepComponentInitialize the component. This methods 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
public JepComponent getLightWeightInstance()
Description copied from interface:JepComponentGets a light-weight instance suitable for using in multiple threads.- Specified by:
getLightWeightInstancein interfaceJepComponent- Returns:
- either an new instance, null or 'this'.
-
eval
public java.lang.Object eval(java.lang.Object[] args) throws EvaluationExceptionDescription copied from class:NaryFunctionEvaluate the function- Specified by:
evalin classNaryFunction- Parameters:
args- arguments to the function- Returns:
- value returned by the function
- Throws:
EvaluationException- if the calculation cannot be performed
-
-