Class Numeric

    • Field Detail

      • NaN

        public static final Numeric NaN
        Constant for the NaN value.
    • Method Detail

      • create

        public static Numeric create​(Number number)
        Return a Numeric instance for the given number.

        Null values or infinite Double or Float are rejected.

        Parameters:
        number - the number
        Returns:
        the Numeric value
        Throws:
        NumberFormatException - when the number is infinite
      • parse

        public static Numeric parse​(String s)
        Parse and return a Numeric instance for the given s.

        The string "Nan" will return the NaN instance.

        Parameters:
        s - the string
        Returns:
        the Numeric value
      • shortValue

        public short shortValue()
        Overrides:
        shortValue in class Number
      • intValue

        public int intValue()
        Specified by:
        intValue in class Number
      • longValue

        public long longValue()
        Specified by:
        longValue in class Number
      • floatValue

        public float floatValue()
        Specified by:
        floatValue in class Number
      • doubleValue

        public double doubleValue()
        Specified by:
        doubleValue in class Number
      • isNaN

        public boolean isNaN()
        Returns:
        true when this number represents NaN
      • bigDecimalValue

        public BigDecimal bigDecimalValue()
        Returns:
        the numeric value represented by this object after conversion to type BigDecimal. It can be null when this instance represents the NaN value.
      • bigIntegerValue

        public BigInteger bigIntegerValue()
        Returns:
        the numeric value represented by this object after conversion to type BigInteger. It can be null when this instance represents the NaN value.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object