Class Decimal64

    • Constructor Detail

      • Decimal64

        protected Decimal64​(Decimal64 other)
    • Method Detail

      • valueOf

        public static Decimal64 valueOf​(byte byteVal)
      • valueOf

        public static Decimal64 valueOf​(short shortVal)
      • valueOf

        public static Decimal64 valueOf​(int intVal)
      • valueOf

        public static Decimal64 valueOf​(long longVal)
      • valueOf

        public static Decimal64 valueOf​(double doubleVal)
      • valueOf

        public static Decimal64 valueOf​(String str)
        Attempt to parse a String into a Decimal64. This method uses minimum fraction digits required to hold the entire value.
        Parameters:
        str - String to parser
        Returns:
        A Decimal64 instance
        Throws:
        NullPointerException - if value is null.
        NumberFormatException - if the string does not contain a parsable decimal64.
      • decimalValue

        public final BigDecimal decimalValue()
      • intValue

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

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

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

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

        public final byte byteValueExact()
        Converts this BigDecimal to a byte, checking for lost information. If this Decimal64 has a nonzero fractional part or is out of the possible range for a byte result then an ArithmeticException is thrown.
        Returns:
        this Decimal64 converted to a byte.
        Throws:
        ArithmeticException - if this has a nonzero fractional part, or will not fit in a byte.
      • shortValueExact

        public final short shortValueExact()
        Converts this BigDecimal to a short, checking for lost information. If this Decimal64 has a nonzero fractional part or is out of the possible range for a short result then an ArithmeticException is thrown.
        Returns:
        this Decimal64 converted to a short.
        Throws:
        ArithmeticException - if this has a nonzero fractional part, or will not fit in a short.
      • intValueExact

        public final int intValueExact()
        Converts this BigDecimal to an int, checking for lost information. If this Decimal64 has a nonzero fractional part or is out of the possible range for an int result then an ArithmeticException is thrown.
        Returns:
        this Decimal64 converted to an int.
        Throws:
        ArithmeticException - if this has a nonzero fractional part, or will not fit in an int.
      • longValueExact

        public final long longValueExact()
        Converts this BigDecimal to a long, checking for lost information. If this Decimal64 has a nonzero fractional part then an ArithmeticException is thrown.
        Returns:
        this Decimal64 converted to a long.
        Throws:
        ArithmeticException - if this has a nonzero fractional part.
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public final boolean equals​(@Nullable Object obj)
        Overrides:
        equals in class Object
      • equals

        public final boolean equals​(@Nullable Decimal64 obj)
        A slightly faster version of equals(Object).
        Parameters:
        obj - Decimal64 object
        Returns:
        true if this object is the same as the obj argument; false otherwise.