Class Uint64

    • Field Detail

      • ZERO

        public static final Uint64 ZERO
        Value of 0.
      • ONE

        public static final Uint64 ONE
        Value of 1.
      • TWO

        public static final Uint64 TWO
        Value of 2.
      • TEN

        public static final Uint64 TEN
        Value of 10.
      • MAX_VALUE

        public static final Uint64 MAX_VALUE
        Value of 18446744073709551615.
    • Constructor Detail

      • Uint64

        protected Uint64​(Uint64 other)
    • Method Detail

      • fromLongBits

        public static Uint64 fromLongBits​(long bits)
        Returns an Uint64 corresponding to a given bit representation. The argument is interpreted as an unsigned 64-bit value.
        Parameters:
        bits - unsigned bit representation
        Returns:
        A Uint64 instance
      • valueOf

        public static Uint64 valueOf​(byte byteVal)
        Returns an Uint64 corresponding to a given byteVal. The inverse operation is Number.byteValue().
        Parameters:
        byteVal - byte value
        Returns:
        A Uint64 instance
        Throws:
        IllegalArgumentException - if byteVal is less than zero
      • valueOf

        public static Uint64 valueOf​(short shortVal)
        Returns an Uint64 corresponding to a given shortVal. The inverse operation is Number.shortValue().
        Parameters:
        shortVal - short value
        Returns:
        A Uint64 instance
        Throws:
        IllegalArgumentException - if shortVal is less than zero
      • valueOf

        public static Uint64 valueOf​(int intVal)
        Returns an Uint64 corresponding to a given intVal. The inverse operation is intValue().
        Parameters:
        intVal - int value
        Returns:
        A Uint64 instance
        Throws:
        IllegalArgumentException - if intVal is less than zero
      • valueOf

        public static Uint64 valueOf​(long longVal)
        Returns an Uint64 corresponding to a given longVal, which is checked for range. See also longValue() and fromLongBits(long).
        Parameters:
        longVal - long value
        Returns:
        A Uint8 instance
        Throws:
        IllegalArgumentException - if longVal is less than zero
      • valueOf

        public static Uint64 valueOf​(Uint8 uint)
        Returns an Uint64 corresponding to a given uint.
        Parameters:
        uint - Uint8 value
        Returns:
        A Uint64 instance
        Throws:
        NullPointerException - if uint is null
      • valueOf

        public static Uint64 valueOf​(Uint16 uint)
        Returns an Uint64 corresponding to a given uint.
        Parameters:
        uint - Uint16 value
        Returns:
        A Uint64 instance
        Throws:
        NullPointerException - if uint is null
      • valueOf

        public static Uint64 valueOf​(Uint32 uint)
        Returns an Uint64 corresponding to a given uint.
        Parameters:
        uint - Uint32 value
        Returns:
        A Uint64 instance
        Throws:
        NullPointerException - if uint is null
      • valueOf

        public static Uint64 valueOf​(UnsignedLong ulong)
        Returns an Uint64 corresponding to a given ulong.
        Parameters:
        ulong - UnsignedLong value
        Returns:
        A Uint64 instance
        Throws:
        NullPointerException - if ulong is null
      • valueOf

        public static Uint64 valueOf​(BigInteger bigInt)
        Returns an Uint64 corresponding to a given bigInt.
        Parameters:
        bigInt - BigInteger value
        Returns:
        A Uint64 instance
        Throws:
        NullPointerException - if bigInt is null
        IllegalArgumentException - if bigInt is less than zero or greater than 18446744073709551615
      • valueOf

        public static Uint64 valueOf​(String string)
        Returns an Uint32 holding the value of the specified String, parsed as an unsigned long value.
        Parameters:
        string - String to parse
        Returns:
        A Uint64 instance
        Throws:
        NullPointerException - if string is null
        IllegalArgumentException - if the parsed value is less than zero or greater than 18446744073709551615
        NumberFormatException - if the string does not contain a parsable unsigned long value.
      • valueOf

        public static Uint64 valueOf​(String string,
                                     int radix)
        Returns an Uint64 holding the value of the specified String, parsed as an unsigned long value.
        Parameters:
        string - String to parse
        radix - Radix to use
        Returns:
        A Uint64 instance
        Throws:
        NullPointerException - if string is null
        IllegalArgumentException - if the parsed value is less than zero or greater than 18446744073709551615
        NumberFormatException - if the string does not contain a parsable unsigned long value, or if the radix is outside of allowed range.
      • intValue

        public final int intValue()
        Specified by:
        intValue 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
      • intern

        public final Uint64 intern()
        Return an interned (shared) instance equivalent to this object. This may return the same object.
        Returns:
        A shared instance.
      • toJava

        public final BigInteger toJava()
        Convert this value to a BigInteger.
        Returns:
        A BigInteger instance
      • toGuava

        public final UnsignedLong toGuava()
        Convert this value to an UnsignedLong.
        Returns:
        An UnsignedLong instance
      • toUint8

        public final Uint8 toUint8()
        Convert this value to a Uint8.
        Returns:
        A Uint8
        Throws:
        IllegalArgumentException - if this value is greater than 255.
      • toUint16

        public final Uint16 toUint16()
        Convert this value to a Uint16.
        Returns:
        A Uint16
        Throws:
        IllegalArgumentException - if this value is greater than 65535.
      • toUint32

        public final Uint32 toUint32()
        Convert this value to a Uint64.
        Returns:
        A Uint32
        Throws:
        IllegalArgumentException - if this value is greater than 4294967295.
      • 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 Uint64 obj)
        A slightly faster version of equals(Object).
        Parameters:
        obj - Uint64 object
        Returns:
        true if this object is the same as the obj argument; false otherwise.