-
- All Implemented Interfaces:
-
java.io.Serializable
public class FastNumber extends Number
An extension of Number optimized for speed at the cost of memory.
-
-
Method Summary
Modifier and Type Method Description static FastNumber
orNull(@NonNull() Number number)
Safe-instantiator of FastNumber; returns a null result if the input Number is also null. int
intValue()
long
longValue()
float
floatValue()
double
doubleValue()
boolean
equals(@Nullable() Object o)
To be equal, two instances must both be instances of FastNumber. int
hashCode()
String
toString()
-
-
Method Detail
-
orNull
static FastNumber orNull(@NonNull() Number number)
Safe-instantiator of FastNumber; returns a null result if the input Number is also null.
-
intValue
int intValue()
-
longValue
long longValue()
-
floatValue
float floatValue()
-
doubleValue
double doubleValue()
-
equals
boolean equals(@Nullable() Object o)
To be equal, two instances must both be instances of FastNumber. The inner field must also be a common type. Numbers which are mathematically equal are notnecessarily equal. This keeps with the java implementation of common Number classes where forinstance
{@code new Integer(0).equals(new Double(0))}
returns{@code false}
-
hashCode
int hashCode()
-
-
-
-