This class contains static methods to evaluate operations on Numeric
operands. If the operands are absolute numerics the result is computed
rigth away and a new absolute numeric is return. If one of the operands are
relative a n operation node is created with the operation and the operands.
The evaluation of the operation can then occur when getNumericValue() is
called.
abs
public static Numeric abs(Numeric op)
throws PropertyException
Return the absolute value of a Numeric.
- a new Numeric object representing the absolute value of the operand.
addition
public static Numeric addition(Numeric op1,
Numeric op2)
throws PropertyException
Add the two operands and return a new Numeric representing the result.
op1
- The first operand.op2
- The second operand.
- A Numeric representing the result.
PropertyException
- If the dimension of the operand is different
from the dimension of this Numeric.
divide
public static Numeric divide(Numeric op1,
Numeric op2)
throws PropertyException
Divide the second operand into the first and return a new
Numeric representing the
result.
op1
- The first operand.op2
- The second operand.
- A Numeric representing the result.
PropertyException
- If the dimension of the operand is different
from the dimension of this Numeric.
max
public static Numeric max(Numeric op1,
Numeric op2)
throws PropertyException
Return the larger of the two Numerics.
op1
- The first operand.op2
- The second operand.
- a Numeric which is the maximum of the two operands.
min
public static Numeric min(Numeric op1,
Numeric op2)
throws PropertyException
Return the smaller of two Numerics.
op1
- The first operand.op2
- The second operand.
- a Numeric which is the minimum of the two operands.
modulo
public static Numeric modulo(Numeric op1,
Numeric op2)
throws PropertyException
Return the remainder of a division of the two operand Numeric.
op1
- The first operand.op2
- The second operand.
- A new Numeric object representing the absolute value.
multiply
public static Numeric multiply(Numeric op1,
Numeric op2)
throws PropertyException
Multiply the two operands and return a new Numeric representing the
result.
op1
- The first operand.op2
- The second operand.
- A Numeric representing the result.
PropertyException
- If the dimension of the operand is different
from the dimension of this Numeric.
negate
public static Numeric negate(Numeric op)
throws PropertyException
Return the negation of a Numeric.
- a new Numeric object representing the negation of the operand.
subtraction
public static Numeric subtraction(Numeric op1,
Numeric op2)
throws PropertyException
Add the second operand from the first and return a new Numeric
representing the result.
op1
- The first operand.op2
- The second operand.
- A Numeric representing the result.
PropertyException
- If the dimension of the operand is different
from the dimension of this Numeric.