Class Uint8

    • Field Detail

      • ZERO

        public static final Uint8 ZERO
        Value of 0.
      • ONE

        public static final Uint8 ONE
        Value of 1.
      • TWO

        public static final Uint8 TWO
        Value of 2.
      • TEN

        public static final Uint8 TEN
        Value of 10.
      • MAX_VALUE

        public static final Uint8 MAX_VALUE
        Value of 255.
    • Constructor Detail

      • Uint8

        protected Uint8​(Uint8 other)
    • Method Detail

      • fromByteBits

        public static Uint8 fromByteBits​(byte bits)
        Returns an Uint8 corresponding to a given bit representation. The argument is interpreted as an unsigned 8-bit value.
        Parameters:
        bits - unsigned bit representation
        Returns:
        A Uint8 instance
      • valueOf

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

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

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

        public static Uint8 valueOf​(long longVal)
        Returns an Uint8 corresponding to a given longVal. The inverse operation is longValue().
        Parameters:
        longVal - long value
        Returns:
        A Uint8 instance
        Throws:
        IllegalArgumentException - if intVal is less than zero or greater than 255.
      • valueOf

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

        public static Uint8 valueOf​(String string,
                                    int radix)
        Returns an Uint8 holding the value of the specified String, parsed as an unsigned short value.
        Parameters:
        string - String to parse
        radix - Radix to use
        Returns:
        A Uint8 instance
        Throws:
        NullPointerException - if string is null
        IllegalArgumentException - if the parsed value is less than zero or greater than 255
        NumberFormatException - if the string does not contain a parsable unsigned short value, or if the radix is outside of allowed range.
      • 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
      • toJava

        public final short toJava()
        Convert this value to a short.
        Returns:
        A short
      • toUint16

        public final Uint16 toUint16()
        Convert this value to a Uint16.
        Returns:
        A Uint16
      • toUint32

        public final Uint32 toUint32()
        Convert this value to a Uint32.
        Returns:
        A Uint32
      • toUint64

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