Class NumberMath<T extends java.lang.Number>
- java.lang.Object
-
- org.checkerframework.common.value.util.NumberMath<T>
-
- Direct Known Subclasses:
ByteMath
,DoubleMath
,FloatMath
,IntegerMath
,LongMath
,ShortMath
public abstract class NumberMath<T extends java.lang.Number> extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description NumberMath()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract java.lang.Number
bitwiseAnd(java.lang.Number right)
abstract java.lang.Number
bitwiseComplement()
abstract java.lang.Number
bitwiseOr(java.lang.Number right)
abstract java.lang.Number
bitwiseXor(java.lang.Number right)
abstract @Nullable java.lang.Number
divide(java.lang.Number right)
Returns the result of dividing thethis
byright
.abstract java.lang.Boolean
equalTo(java.lang.Number right)
static @Nullable NumberMath<?>
getNumberMath(java.lang.Number number)
abstract java.lang.Boolean
greaterThan(java.lang.Number right)
abstract java.lang.Boolean
greaterThanEq(java.lang.Number right)
static boolean
isIntegralZero(java.lang.Number number)
abstract java.lang.Boolean
lessThan(java.lang.Number right)
abstract java.lang.Boolean
lessThanEq(java.lang.Number right)
abstract java.lang.Number
minus(java.lang.Number right)
abstract java.lang.Boolean
notEqualTo(java.lang.Number right)
abstract java.lang.Number
plus(java.lang.Number right)
abstract @Nullable java.lang.Number
remainder(java.lang.Number right)
Returns the result ofthis % right
.abstract java.lang.Number
shiftLeft(java.lang.Number right)
abstract java.lang.Number
signedShiftRight(java.lang.Number right)
abstract java.lang.Number
times(java.lang.Number right)
abstract java.lang.Number
unaryMinus()
abstract java.lang.Number
unaryPlus()
abstract java.lang.Number
unsignedShiftRight(java.lang.Number right)
-
-
-
Method Detail
-
getNumberMath
public static @Nullable NumberMath<?> getNumberMath(java.lang.Number number)
-
plus
public abstract java.lang.Number plus(java.lang.Number right)
-
minus
public abstract java.lang.Number minus(java.lang.Number right)
-
times
public abstract java.lang.Number times(java.lang.Number right)
-
divide
public abstract @Nullable java.lang.Number divide(java.lang.Number right)
Returns the result of dividing thethis
byright
. Ifright
is zero and this is an integer division,null
is returned.
-
remainder
public abstract @Nullable java.lang.Number remainder(java.lang.Number right)
Returns the result ofthis % right
. Ifright
is zero and this is an integer remainder,null
is returned.
-
shiftLeft
public abstract java.lang.Number shiftLeft(java.lang.Number right)
-
signedShiftRight
public abstract java.lang.Number signedShiftRight(java.lang.Number right)
-
unsignedShiftRight
public abstract java.lang.Number unsignedShiftRight(java.lang.Number right)
-
bitwiseAnd
public abstract java.lang.Number bitwiseAnd(java.lang.Number right)
-
bitwiseOr
public abstract java.lang.Number bitwiseOr(java.lang.Number right)
-
bitwiseXor
public abstract java.lang.Number bitwiseXor(java.lang.Number right)
-
unaryPlus
public abstract java.lang.Number unaryPlus()
-
unaryMinus
public abstract java.lang.Number unaryMinus()
-
bitwiseComplement
public abstract java.lang.Number bitwiseComplement()
-
equalTo
public abstract java.lang.Boolean equalTo(java.lang.Number right)
-
notEqualTo
public abstract java.lang.Boolean notEqualTo(java.lang.Number right)
-
greaterThan
public abstract java.lang.Boolean greaterThan(java.lang.Number right)
-
greaterThanEq
public abstract java.lang.Boolean greaterThanEq(java.lang.Number right)
-
lessThan
public abstract java.lang.Boolean lessThan(java.lang.Number right)
-
lessThanEq
public abstract java.lang.Boolean lessThanEq(java.lang.Number right)
-
isIntegralZero
public static boolean isIntegralZero(java.lang.Number number)
-
-