Package com.singularsys.jep.functions
Class Add
java.lang.Object
com.singularsys.jep.functions.PostfixMathCommand
com.singularsys.jep.functions.NaryBinaryFunction
com.singularsys.jep.functions.Add
- All Implemented Interfaces:
PostfixMathCommandI,RealBinaryFunction,Serializable
- Direct Known Subclasses:
BigDecAdd
Addition function. Supports any number of parameters although typically
only 2 parameters are used.
- Since:
- Jep 4.1 can work with
List<?>. - Author:
- nathan
- See Also:
-
Field Summary
Fields inherited from class com.singularsys.jep.functions.PostfixMathCommand
curNumberOfParameters, description, name, NaN, numberOfParameters -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class com.singularsys.jep.functions.NaryBinaryFunction
checkNumberOfParameters, eval, instanceOf, instanceOf, instanceOf, instanceOf, 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
-
Add
public Add()
-
-
Method Details
-
eval
Description copied from class:NaryBinaryFunctionEvaluate given a pair of arguments. Must be specified for all implementing classes.- Specified by:
evalin classNaryBinaryFunction- Parameters:
l- lhs argumentr- rhs argument- Returns:
- result of applying the function to the arguments
- Throws:
EvaluationException- on error.
-
add
Adds two numbers together. The parameters can be of type Number, Complex, or String. If a certain combination of types is not supported, a EvaluationException is thrown.- Parameters:
param1- The first parameter to be added.param2- The second parameter to be added.- Returns:
- The sum of param1 and param2, or concatenation of the two if they are Strings.
- Throws:
EvaluationException- if the calculation cannot be performed
-
add
-
add
-
add
- Throws:
EvaluationException
-
add
-
evaluate
public double evaluate(double l, double r) - Specified by:
evaluatein interfaceRealBinaryFunction
-