Class NullWrappedNaryBinary
java.lang.Object
com.singularsys.jep.functions.PostfixMathCommand
com.singularsys.jep.functions.NaryFunction
com.singularsys.jep.misc.nullwrapper.functions.NullWrappedNaryBinary
- All Implemented Interfaces:
NullWrappedFunctionI,PostfixMathCommandI,Serializable
Wrap a NaryBinaryFunction so that if any argument is null then null is returned.
- See Also:
-
Field Summary
Fields inherited from class com.singularsys.jep.functions.PostfixMathCommand
curNumberOfParameters, name, NaN, numberOfParameters -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancheckNumberOfParameters(int n) Checks the number of parameters of the function.Evaluate the functionintReturn the required number of parameters.getRoot()Get to function which this function wraps.voidsetCurNumberOfParameters(int n) Sets the number of current number of parameters used in the next call of run().voidSets the name of the function used for error messagesMethods inherited from class com.singularsys.jep.functions.NaryFunction
run
-
Constructor Details
-
NullWrappedNaryBinary
- Parameters:
fun- the function to be wrapped
-
-
Method Details
-
eval
Description 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
-
setName
Description copied from interface:PostfixMathCommandISets the name of the function used for error messages- Specified by:
setNamein interfacePostfixMathCommandI- Overrides:
setNamein classPostfixMathCommand- Parameters:
name- the function name
-
getRoot
Description copied from interface:NullWrappedFunctionIGet to function which this function wraps.- Specified by:
getRootin interfaceNullWrappedFunctionI- Returns:
- the root function, may be "this".
-
checkNumberOfParameters
public boolean checkNumberOfParameters(int n) Description copied from class:PostfixMathCommandChecks the number of parameters of the function. Functions which set numberOfParameter=-1 should overload this method- Specified by:
checkNumberOfParametersin interfacePostfixMathCommandI- Overrides:
checkNumberOfParametersin classPostfixMathCommand- Parameters:
n- number of parameters function will be called with.- Returns:
- false if an illegal number of parameters is supplied, true otherwise.
-
getNumberOfParameters
public int getNumberOfParameters()Description copied from class:PostfixMathCommandReturn the required number of parameters.- Specified by:
getNumberOfParametersin interfacePostfixMathCommandI- Overrides:
getNumberOfParametersin classPostfixMathCommand- Returns:
- allowable number of parameters, -1 if a variable number is allowed
-
setCurNumberOfParameters
public void setCurNumberOfParameters(int n) Description copied from class:PostfixMathCommandSets the number of current number of parameters used in the next call of run(). This method is only called when the reqNumberOfParameters is -1.- Specified by:
setCurNumberOfParametersin interfacePostfixMathCommandI- Overrides:
setCurNumberOfParametersin classPostfixMathCommand- Parameters:
n- number of parameter for next call of function
-