| Modifier and Type | Class and Description |
|---|---|
| private static enum | DefaultNumberSystem.
In order of increasing number type 'widening'. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Number | abs(final Number number)
Implements tech. Returns the absolute of given |
| public Number | add(final Number x, final Number y)
Implements tech. Returns the sum of given |
| private Number | addWideAndNarrow(final DefaultNumberSystem.
|
| private static Number[] | |
| private int | |
| public int | compare(final Number x, final Number y)
Implements tech. Compares two |
| private int | compareWideVsNarrow(final DefaultNumberSystem.
- currently unused (but future refactoring might use it) unusedNarrowType,
|
| private static BigInteger | |
| private static BigDecimal | |
| public Number | divide(final Number x, final Number y)
Implements tech. Returns the division of given |
| public Number[] | divideAndRemainder(final Number x, final Number y, final boolean
- whether the division remainder should be rounded towards zero roundRemainderTowardsZero)Implements tech. Returns a two-element Number array containing {x / y, x % y} |
| public Number | exp(final Number number)
Implements tech. Returns Euler's Constant to the power of of given |
| private BigInteger | |
| pack-priv static boolean | |
| public boolean | isInteger(final Number number)
Implements tech. Checks whether given |
| private boolean | isInteger(final DefaultNumberSystem.
Whether given |
| private boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public Number | log(final Number number)
Implements tech. Returns the natural logarithm of given |
| public Number | multiply(final Number x, final Number y)
Implements tech. Returns the product of given |
| private Number | multiplyWideAndNarrow(final DefaultNumberSystem.
|
| public Number | narrow(final Number number)
Implements tech. 'Narrows' given |
| public Number | negate(final Number number)
Implements tech. Returns the negation of given |
| public Number | power(final Number number, final int
- an integer exponent)Implements tech. Returns given |
| public Number | reciprocal(final Number number)
Implements tech. Returns the reciprocal of given |
| public int | signum(final Number number)
Implements tech. Returns the signum function of given |
| public Number | subtract(final Number x, final Number y)
Implements tech. Returns the difference of given |
| private BigDecimal | |
| private IllegalStateException | |
| private IllegalArgumentException | |
| private IllegalArgumentException |
| DefaultNumberSystem | back to summary |
|---|---|
| public DefaultNumberSystem() | |
| abs | back to summary |
|---|---|
| public Number abs(final Number number) Implements tech. Doc from tech. Returns the absolute of given | |
| add | back to summary |
|---|---|
| public Number add(final Number x, final Number y) Implements tech. Doc from tech. Returns the sum of given | |
| addWideAndNarrow | back to summary |
|---|---|
| private Number addWideAndNarrow(final DefaultNumberSystem. | |
| applyToArray | back to summary |
|---|---|
| private static Number[] applyToArray(final Number[] array, final UnaryOperator<Number> operator) | |
| bitLengthOfInteger | back to summary |
|---|---|
| private int bitLengthOfInteger(final Number number) | |
| compare | back to summary |
|---|---|
| public int compare(final Number x, final Number y) Implements tech. Doc from tech. Compares two
| |
| compareWideVsNarrow | back to summary |
|---|---|
private int compareWideVsNarrow(final DefaultNumberSystem.
| |
| copySignTo | back to summary |
|---|---|
| private static BigInteger copySignTo(final int sign, final BigInteger absNumber) | |
| copySignTo | back to summary |
|---|---|
| private static BigDecimal copySignTo(final int sign, final BigDecimal absNumber) | |
| divide | back to summary |
|---|---|
| public Number divide(final Number x, final Number y) Implements tech. Doc from tech. Returns the division of given | |
| divideAndRemainder | back to summary |
|---|---|
| public Number[] divideAndRemainder(final Number x, final Number y, final boolean roundRemainderTowardsZero) Implements tech. Doc from tech. Returns a two-element Number array containing {x / y, x % y}
| |
| exp | back to summary |
|---|---|
| public Number exp(final Number number) Implements tech. Doc from tech. Returns Euler's Constant to the power of of given | |
| integerToBigInteger | back to summary |
|---|---|
| private BigInteger integerToBigInteger(final Number number) | |
| isFractional | back to summary |
|---|---|
| pack-priv static boolean isFractional(final BigDecimal decimal) Whether given Implementation Note
| |
| isInteger | back to summary |
|---|---|
| public boolean isInteger(final Number number) Implements tech. Doc from tech. Checks whether given
| |
| isInteger | back to summary |
|---|---|
| private boolean isInteger(final DefaultNumberSystem. Whether given | |
| isIntegerOnly | back to summary |
|---|---|
| private boolean isIntegerOnly(final Number number) Whether the
If Note this does not check whether given number represents an integer. | |
| isLessThanOne | back to summary |
|---|---|
| public boolean isLessThanOne(final Number number) Implements tech.
| |
| isOne | back to summary |
|---|---|
| public boolean isOne(final Number number) Implements tech.
| |
| isZero | back to summary |
|---|---|
| public boolean isZero(final Number number) Implements tech.
| |
| log | back to summary |
|---|---|
| public Number log(final Number number) Implements tech. Doc from tech. Returns the natural logarithm of given | |
| multiply | back to summary |
|---|---|
| public Number multiply(final Number x, final Number y) Implements tech. Doc from tech. Returns the product of given | |
| multiplyWideAndNarrow | back to summary |
|---|---|
| private Number multiplyWideAndNarrow(final DefaultNumberSystem. | |
| narrow | back to summary |
|---|---|
| public Number narrow(final Number number) Implements tech. Doc from tech. 'Narrows' given
eg. A BigInteger that is within range of Java's | |
| negate | back to summary |
|---|---|
| public Number negate(final Number number) Implements tech. Doc from tech. Returns the negation of given | |
| power | back to summary |
|---|---|
| public Number power(final Number number, final int exponent) Implements tech. Doc from tech. Returns given | |
| reciprocal | back to summary |
|---|---|
| public Number reciprocal(final Number number) Implements tech. Doc from tech. Returns the reciprocal of given | |
| signum | back to summary |
|---|---|
| public int signum(final Number number) Implements tech. Doc from tech. Returns the signum function of given
| |
| subtract | back to summary |
|---|---|
| public Number subtract(final Number x, final Number y) Implements tech. Doc from tech. Returns the difference of given | |
| toBigDecimal | back to summary |
|---|---|
| private BigDecimal toBigDecimal(final Number number) | |
| unexpectedCodeReach | back to summary |
|---|---|
| private IllegalStateException unexpectedCodeReach() | |
| unsupportedNumberType | back to summary |
|---|---|
| private IllegalArgumentException unsupportedNumberType(final Number number) | |
| unsupportedNumberValue | back to summary |
|---|---|
| private IllegalArgumentException unsupportedNumberValue(final Number number) | |
| Modifier and Type | Field and Description |
|---|---|
| public static final DefaultNumberSystem. | |
| public static final DefaultNumberSystem. | |
| public static final DefaultNumberSystem. | |
| public static final DefaultNumberSystem. | |
| public static final DefaultNumberSystem. | |
| public static final DefaultNumberSystem. | |
| public static final DefaultNumberSystem. | |
| private final boolean | |
| public static final DefaultNumberSystem. | |
| public static final DefaultNumberSystem. | |
| private final Number | |
| public static final DefaultNumberSystem. | |
| public static final DefaultNumberSystem. | |
| private final Class | |
| private final Number |
| Access | Constructor and Description |
|---|---|
| private | NumberType(final boolean integerOnly, final Class<? extends Number> type, final Number one, final Number zero)
|
| Modifier and Type | Method and Description |
|---|---|
| public Class | |
| public boolean | |
| pack-priv boolean | |
| public static DefaultNumberSystem. | |
| pack-priv static DefaultNumberSystem. | |
| public static DefaultNumberSystem. |
| BIG_DECIMAL | back to summary |
|---|---|
| public static final DefaultNumberSystem. | |
| BIG_INTEGER | back to summary |
|---|---|
| public static final DefaultNumberSystem. | |
| BYTE_BOXED | back to summary |
|---|---|
| public static final DefaultNumberSystem. | |
| DOUBLE_BOXED | back to summary |
|---|---|
| public static final DefaultNumberSystem. | |
| FLOAT_BOXED | back to summary |
|---|---|
| public static final DefaultNumberSystem. | |
| INTEGER_ATOMIC | back to summary |
|---|---|
| public static final DefaultNumberSystem. | |
| INTEGER_BOXED | back to summary |
|---|---|
| public static final DefaultNumberSystem. | |
| integerOnly | back to summary |
|---|---|
| private final boolean integerOnly | |
| LONG_ATOMIC | back to summary |
|---|---|
| public static final DefaultNumberSystem. | |
| LONG_BOXED | back to summary |
|---|---|
| public static final DefaultNumberSystem. | |
| one | back to summary |
|---|---|
| private final Number one | |
| RATIONAL | back to summary |
|---|---|
| public static final DefaultNumberSystem. | |
| SHORT_BOXED | back to summary |
|---|---|
| public static final DefaultNumberSystem. | |
| type | back to summary |
|---|---|
| private final Class<? extends Number> type | |
| zero | back to summary |
|---|---|
| private final Number zero | |
| NumberType | back to summary |
|---|---|
| private NumberType(final boolean integerOnly, final Class<? extends Number> type, final Number one, final Number zero) | |
| getType | back to summary |
|---|---|
public Class
| |
| isIntegerOnly | back to summary |
|---|---|
| public boolean isIntegerOnly() Whether the underlying number type can only represent integers.
If | |
| isZero | back to summary |
|---|---|
| pack-priv boolean isZero(Number number) Whether given API Note For class internal use only, such that we have control over the number's type that gets passed in. | |
| valueOf | back to summary |
|---|---|
| public static DefaultNumberSystem. | |
| valueOf | back to summary |
|---|---|
| pack-priv static DefaultNumberSystem. | |
| values | back to summary |
|---|---|
| public static DefaultNumberSystem. | |