|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectariba.util.core.ArithmeticUtil
public abstract class ArithmeticUtil
Constructor Summary | |
---|---|
ArithmeticUtil()
|
Method Summary | |
---|---|
static java.lang.Number |
add(java.lang.Number first,
java.lang.Number second)
Adds first to second and returns
the result. |
static int |
compare(java.lang.Number first,
java.lang.Number second)
Compares first to second and returns
the result. |
static java.lang.Number |
divide(java.lang.Number first,
java.lang.Number second)
Divides first by second and returns
the result. |
static java.lang.Number |
evaluate(java.lang.Number first,
Arithmetic.Operation operation,
java.lang.Number second)
Evaluates first to second with respect
to the specified operation and returns the
result. |
static Arithmetic |
getArithmetic(java.lang.Number first,
java.lang.Number second)
Returns the instance of Arithmetic corresponding to evaluating
a simple arithmetic expression containing first and
second . |
static boolean |
isInteger(java.lang.Number number)
Returns true if number is one of the
integer types and false otherwise. |
static java.lang.Number |
multiply(java.lang.Number first,
java.lang.Number second)
Multiplies first by second and returns
the result. |
static java.lang.Number |
subtract(java.lang.Number first,
java.lang.Number second)
Subtracts second from first and returns
the result. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ArithmeticUtil()
Method Detail |
---|
public static Arithmetic getArithmetic(java.lang.Number first, java.lang.Number second)
Arithmetic
corresponding to evaluating
a simple arithmetic expression containing first
and
second
.
first
- the first Number
; may not be null
second
- the second Number
; may not be null
null
public static boolean isInteger(java.lang.Number number)
true
if number
is one of the
integer types and false
otherwise.
public static java.lang.Number evaluate(java.lang.Number first, Arithmetic.Operation operation, java.lang.Number second)
first
to second
with respect
to the specified operation
and returns the
result.
The value operation
must be one of:
OpAdd, OpSubtract, OpMultiply, OpDivide
.
first
- the first number; may not be null
operation
- the arithmetic operationsecond
- the second number; may not be null
public static java.lang.Number add(java.lang.Number first, java.lang.Number second)
first
to second
and returns
the result.
first
- the first number; may not be null
second
- the second number; may not be null
public static java.lang.Number subtract(java.lang.Number first, java.lang.Number second)
second
from first
and returns
the result.
first
- the first number; may not be null
second
- the second number; may not be null
public static java.lang.Number multiply(java.lang.Number first, java.lang.Number second)
first
by second
and returns
the result.
first
- the first number; may not be null
second
- the second number; may not be null
public static java.lang.Number divide(java.lang.Number first, java.lang.Number second)
first
by second
and returns
the result.
first
- the first number; may not be null
second
- the second number; may not be null
public static int compare(java.lang.Number first, java.lang.Number second)
first
to second
and returns
the result.
first
- the first number; may not be null
second
- the second number; may not be null
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |