public abstract class NumberMath extends Object
Constructor and Description |
---|
NumberMath() |
Modifier and Type | Method and Description |
---|---|
static Number |
abs(Number number) |
protected abstract Number |
absImpl(Number number) |
static Number |
add(Number left,
Number right) |
abstract Number |
addImpl(Number left,
Number right) |
static Number |
and(Number left,
Number right) |
protected Number |
andImpl(Number left,
Number right) |
static Number |
bitwiseNegate(Number left) |
protected Number |
bitwiseNegateImpl(Number left) |
static int |
compareTo(Number left,
Number right) |
abstract int |
compareToImpl(Number left,
Number right) |
protected UnsupportedOperationException |
createUnsupportedException(String operation,
Number left) |
static Number |
divide(Number left,
Number right) |
abstract Number |
divideImpl(Number left,
Number right) |
static NumberMath |
getMath(Number left,
Number right)
Determine which NumberMath instance to use, given the supplied operands.
|
static Number |
intdiv(Number left,
Number right) |
protected Number |
intdivImpl(Number left,
Number right) |
static boolean |
isBigDecimal(Number number) |
static boolean |
isBigInteger(Number number) |
static boolean |
isFloatingPoint(Number number) |
static boolean |
isInteger(Number number) |
static boolean |
isLong(Number number) |
static Number |
leftShift(Number left,
Number right)
For this operation, consider the operands independently.
|
protected Number |
leftShiftImpl(Number left,
Number right) |
static Number |
mod(Number left,
Number right) |
protected Number |
modImpl(Number left,
Number right) |
static Number |
multiply(Number left,
Number right) |
abstract Number |
multiplyImpl(Number left,
Number right) |
static Number |
or(Number left,
Number right) |
protected Number |
orImpl(Number left,
Number right) |
static Number |
rightShift(Number left,
Number right)
For this operation, consider the operands independently.
|
protected Number |
rightShiftImpl(Number left,
Number right) |
static Number |
rightShiftUnsigned(Number left,
Number right)
For this operation, consider the operands independently.
|
protected Number |
rightShiftUnsignedImpl(Number left,
Number right) |
static Number |
subtract(Number left,
Number right) |
abstract Number |
subtractImpl(Number left,
Number right) |
static BigDecimal |
toBigDecimal(Number n) |
static BigInteger |
toBigInteger(Number n) |
static Number |
unaryMinus(Number left) |
protected abstract Number |
unaryMinusImpl(Number left) |
static Number |
unaryPlus(Number left) |
protected abstract Number |
unaryPlusImpl(Number left) |
static Number |
xor(Number left,
Number right) |
protected Number |
xorImpl(Number left,
Number right) |
public static Number leftShift(Number left, Number right)
public static Number rightShift(Number left, Number right)
public static Number rightShiftUnsigned(Number left, Number right)
public static boolean isFloatingPoint(Number number)
public static boolean isInteger(Number number)
public static boolean isLong(Number number)
public static boolean isBigDecimal(Number number)
public static boolean isBigInteger(Number number)
public static BigDecimal toBigDecimal(Number n)
public static BigInteger toBigInteger(Number n)
public static NumberMath getMath(Number left, Number right)
protected UnsupportedOperationException createUnsupportedException(String operation, Number left)