net.christopherschultz.evaluator.function
Class Difference
java.lang.Object
net.christopherschultz.evaluator.StandardFunction
net.christopherschultz.evaluator.function.MathFunction
net.christopherschultz.evaluator.function.Difference
- All Implemented Interfaces:
- Function
public class Difference
- extends MathFunction
Implements numeric subtraction.
This function takes any number of arguments and returns the arithmetic
difference between them. No arguments returns zero. One argument returns
the negavite of that argument. More than one argument returns the first
argument with each of the remaining arguments subtracted from it.
The following data types are supported:
byte, short, int, long, float, and double.
The return type is chosen based upon the widest-typed argument passed
into the function. The types are listed above from narrowest to widest.
- Version:
- $Revision: 1.2 $ $Date: 2008-06-20 22:58:48 $
- Author:
- Chris Schultz
Nested classes/interfaces inherited from class net.christopherschultz.evaluator.function.MathFunction |
MathFunction.abs, MathFunction.acos, MathFunction.asin, MathFunction.atan, MathFunction.ceil, MathFunction.cos, MathFunction.DoubleFunction, MathFunction.exp, MathFunction.floor, MathFunction.heaviside, MathFunction.log, MathFunction.max, MathFunction.min, MathFunction.pow, MathFunction.random, MathFunction.rint, MathFunction.sin, MathFunction.sqrt, MathFunction.tan, MathFunction.toDegrees, MathFunction.toRadians |
Difference
public Difference()
call
public Object call(EvaluationContext ec,
String functionName,
Object[] arguments)
throws EvaluationException
- Description copied from class:
StandardFunction
- Calls this function with standard argument evaluation semantics.
- Specified by:
call
in class StandardFunction
- Parameters:
ec
- The EvaluationContext in which this function is being called.functionName
- The name of the function being invoked.arguments
- The argument values to pass to this function.
- Returns:
- The result of the function.
- Throws:
EvaluationException
- If there is an error during function
execution.