net.christopherschultz.evaluator.function
Class MathFunction.heaviside
java.lang.Object
net.christopherschultz.evaluator.StandardFunction
net.christopherschultz.evaluator.function.MathFunction
net.christopherschultz.evaluator.function.MathFunction.heaviside
- All Implemented Interfaces:
- Function
- Enclosing class:
- MathFunction
public static class MathFunction.heaviside
- extends MathFunction
Implements a heaviside function which takes a numeric or boolean
argument.
This function accepts a numeric or boolean argument and returns an
integer:
zero if the argument is false or less than zero, and 1 if the argument
is true. The heaviside function has a discontunity at an argument value
of zero. This implementation returns zero in that case. This
implementation also accepts null as an argument value,
and will return zero in that case.
| 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 |
MathFunction.heaviside
public MathFunction.heaviside()
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.