public class NullWrappedFunctionFactory extends java.lang.Object implements JepComponent
Constructor and Description |
---|
NullWrappedFunctionFactory() |
Modifier and Type | Method and Description |
---|---|
JepComponent |
getLightWeightInstance()
Gets a light-weight instance suitable for using in multiple threads.
|
protected PostfixMathCommandI |
getSpecialFunction(PostfixMathCommandI fun)
Handles special functions.
|
PostfixMathCommandI |
getWrappedFunction(PostfixMathCommandI fun)
Gets a wrapped function, returns a function which will handle null values correctly.
|
void |
init(Jep jep)
Initialize the component.
|
public PostfixMathCommandI getWrappedFunction(PostfixMathCommandI fun)
getSpecialFunction(PostfixMathCommandI)
and returns any non null results.fun
implements CallbackEvaluationI
then it cannot be wrapped and null is returned.fun
implements NullWrappedFunctionI
then it is alread wrapped and fun
is returned.fun
implements UnaryFunction
then it is wrapped by NullWrapperUnary
which is returned.fun
implements BinaryFunction
then it is wrapped by NullWrapperBinary
which is returned.fun
implements NaryFunction
then it is wrapped by NullWrapperNary
which is returned.fun
implements NaryBinaryFunction
then it is wrapped by NullWrapperNaryBinary
which is returned.fun
has zero arguments then it does not need to wrap functions and fun
.fun
implements PostfixMathCommand
then it is wrapped by NullWrapperPfmc
which is returned.fun
is returned.fun
- the function to be wrappedprotected PostfixMathCommandI getSpecialFunction(PostfixMathCommandI fun)
If
and TernaryConditional
are replaced by NullWrappedIf
.LazyLogical
functions are replaced by NullLazyLogical
.AbstractInc
are wrapped by NullAbstractInc
Assign
, List
, Ele
, IsNull
,
all handle null correctly so the original function is returned.Case
, Switch
, SwitchDefault
instances of these which handle nulls correctly are returned.
fun
- original functionpublic JepComponent getLightWeightInstance()
JepComponent
getLightWeightInstance
in interface JepComponent
public void init(Jep jep)
JepComponent
init
in interface JepComponent
jep
- the current Jep instanceCopyright © 2018 Singular Systems http://www.singularsys.com/jep