|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.christopherschultz.evaluator.StandardFunction net.christopherschultz.evaluator.function.MathFunction net.christopherschultz.evaluator.function.BinaryOperator
public abstract class BinaryOperator
Provdes implementations of standard mathematical, logical, and relational binary operators including the following usual suspects: +, -, *, /, =, !=, >, <, >=, <=, &&, ||
Nested Class Summary | |
---|---|
static class |
BinaryOperator.Add
Implements addition. |
static class |
BinaryOperator.And
Implements logical AND. |
static class |
BinaryOperator.Divide
Implements division. |
static class |
BinaryOperator.Equal
Implements equals. |
static class |
BinaryOperator.Greater
Implements greater-than. |
static class |
BinaryOperator.GreaterEqual
Implements generic greater-than or equal to. |
static class |
BinaryOperator.IncompatibleArgumentsException
|
static class |
BinaryOperator.Less
Implements less than. |
static class |
BinaryOperator.LessEqual
Implements greater-than. |
static class |
BinaryOperator.Modulus
Implements modulus (remainder). |
static class |
BinaryOperator.Multiply
Implements multiplication. |
static class |
BinaryOperator.NotEqual
Implements unequal. |
static class |
BinaryOperator.Or
Implements logical OR. |
static class |
BinaryOperator.Subtract
Implements subtraction. |
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 |
Field Summary |
---|
Fields inherited from class net.christopherschultz.evaluator.function.MathFunction |
---|
ALLOW_NULL_COMPARISON, NULL_RETURNS_NULL |
Constructor Summary | |
---|---|
BinaryOperator()
|
Method Summary | |
---|---|
protected abstract Object |
call(EvaluationContext ec,
Object lvalue,
Object rvalue)
|
Object |
call(EvaluationContext ec,
String functionName,
Object[] args)
Checks for exactly two arguments and calls the subclass's 2-argument call function. |
Methods inherited from class net.christopherschultz.evaluator.StandardFunction |
---|
call, getExpressionValue, getExpressionValueArray, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BinaryOperator()
Method Detail |
---|
public Object call(EvaluationContext ec, String functionName, Object[] args) throws EvaluationException
call
in class StandardFunction
ec
- The EvaluationContext in which this function is being called.functionName
- The name of the function being invoked.args
- The argument values to pass to this function.
EvaluationException
- If there is an error during function
execution.protected abstract Object call(EvaluationContext ec, Object lvalue, Object rvalue) throws EvaluationException
EvaluationException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |