Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Type | Name and description |
---|---|
static Number |
abs(Number number) |
protected Number |
absImpl(Number number) |
static Number |
add(Number left, Number right) |
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) |
int |
compareToImpl(Number left, Number right) |
protected UnsupportedOperationException |
createUnsupportedException(String operation, Number left) |
static Number |
divide(Number left, Number right) |
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) |
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) |
Number |
subtractImpl(Number left, Number right) |
static BigDecimal |
toBigDecimal(Number n) |
static BigInteger |
toBigInteger(Number n) |
static Number |
unaryMinus(Number left) |
protected Number |
unaryMinusImpl(Number left) |
static Number |
unaryPlus(Number left) |
protected Number |
unaryPlusImpl(Number left) |
static Number |
xor(Number left, Number right) |
protected Number |
xorImpl(Number left, Number right) |
Determine which NumberMath instance to use, given the supplied operands. This method implements the type promotion rules discussed in the documentation. Note that by the time this method is called, any Byte, Character or Short operands will have been promoted to Integer. For reference, here is the promotion matrix: bD bI D F L I bD bD bD D D bD bD bI bD bI D D bI bI D D D D D D D F D D D D D D L bD bI D D L L I bD bI D D L I Note that for division, if either operand isFloatingPoint, the result will be floating. Otherwise, the result is BigDecimal
For this operation, consider the operands independently. Throw an exception if the right operand (shift distance) is not an integral type. For the left operand (shift value) also require an integral type, but do NOT promote from Integer to Long. This is consistent with Java, and makes sense for the shift operators.
For this operation, consider the operands independently. Throw an exception if the right operand (shift distance) is not an integral type. For the left operand (shift value) also require an integral type, but do NOT promote from Integer to Long. This is consistent with Java, and makes sense for the shift operators.
For this operation, consider the operands independently. Throw an exception if the right operand (shift distance) is not an integral type. For the left operand (shift value) also require an integral type, but do NOT promote from Integer to Long. This is consistent with Java, and makes sense for the shift operators.