Package 

Class FastNumber

  • 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()
      • Methods inherited from class java.lang.Number

        byteValue, doubleValue, floatValue, intValue, longValue, shortValue
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • orNull

         static FastNumber orNull(@NonNull() Number number)

        Safe-instantiator of FastNumber; returns a null result if the input Number is also null.

      • 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}