Package com.singularsys.jeptests.unit
Class LightWeightComponentSetTest.NonThreadSafeFunction
- java.lang.Object
-
- com.singularsys.jep.functions.PostfixMathCommand
-
- com.singularsys.jep.functions.NullaryFunction
-
- com.singularsys.jeptests.unit.LightWeightComponentSetTest.NonThreadSafeFunction
-
- All Implemented Interfaces:
JepComponent
,PostfixMathCommandI
,java.io.Serializable
- Enclosing class:
- LightWeightComponentSetTest
public static class LightWeightComponentSetTest.NonThreadSafeFunction extends NullaryFunction implements JepComponent
A function implementing JepComponent which requires different instances for each thread.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.singularsys.jep.functions.PostfixMathCommand
curNumberOfParameters, name, NaN, numberOfParameters
-
-
Constructor Summary
Constructors Constructor Description NonThreadSafeFunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
eval()
Evaluate the functionJepComponent
getLightWeightInstance()
Gets a light-weight instance suitable for using in multiple threads.void
init(Jep jep)
Initialize the component.java.lang.String
toString()
-
Methods inherited from class com.singularsys.jep.functions.NullaryFunction
instanceOf, run
-
Methods inherited from class com.singularsys.jep.functions.PostfixMathCommand
asArray, asBool, asDouble, asInt, asLong, asStrictInt, asString, checkNumberOfParameters, getName, getNumberOfParameters, setCurNumberOfParameters, setName, toString
-
-
-
-
Method Detail
-
init
public void init(Jep jep)
Description copied from interface:JepComponent
Initialize 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:
init
in interfaceJepComponent
- 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 interfaceJepComponent
- Returns:
- either an new instance, null or 'this'.
-
eval
public java.lang.Object eval() throws EvaluationException
Description copied from class:NullaryFunction
Evaluate the function- Specified by:
eval
in classNullaryFunction
- Returns:
- value of the function
- Throws:
EvaluationException
-
toString
public java.lang.String toString()
- Overrides:
toString
in classPostfixMathCommand
-
-