|
|||||||||
| 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 Number |
add(Number first,
Number second)
Adds first to second and returns
the result. |
static int |
compare(Number first,
Number second)
Compares first to second and returns
the result. |
static Number |
divide(Number first,
Number second)
Divides first by second and returns
the result. |
static Number |
evaluate(Number first,
Arithmetic.Operation operation,
Number second)
Evaluates first to second with respect
to the specified operation and returns the
result. |
static Arithmetic |
getArithmetic(Number first,
Number second)
Returns the instance of Arithmetic corresponding to evaluating
a simple arithmetic expression containing first and
second. |
static boolean |
isInteger(Number number)
Returns true if number is one of the
integer types and false otherwise. |
static Number |
multiply(Number first,
Number second)
Multiplies first by second and returns
the result. |
static Number |
subtract(Number first,
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(Number first,
Number second)
Arithmetic corresponding to evaluating
a simple arithmetic expression containing first and
second.
first - the first Number; may not be nullsecond - the second Number; may not be null
nullpublic static boolean isInteger(Number number)
true if number is one of the
integer types and false otherwise.
public static Number evaluate(Number first,
Arithmetic.Operation operation,
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 nulloperation - the arithmetic operationsecond - the second number; may not be null
public static Number add(Number first,
Number second)
first to second and returns
the result.
first - the first number; may not be nullsecond - the second number; may not be null
public static Number subtract(Number first,
Number second)
second from first and returns
the result.
first - the first number; may not be nullsecond - the second number; may not be null
public static Number multiply(Number first,
Number second)
first by second and returns
the result.
first - the first number; may not be nullsecond - the second number; may not be null
public static Number divide(Number first,
Number second)
first by second and returns
the result.
first - the first number; may not be nullsecond - the second number; may not be null
public static int compare(Number first,
Number second)
first to second and returns
the result.
first - the first number; may not be nullsecond - the second number; may not be null
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||