Class UByte

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<UByte>

    public final class UByte
    extends UNumber
    implements java.lang.Comparable<UByte>
    The unsigned byte type
    Author:
    Lukas Eder, Ed Schaller, Jens Nerche
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static UByte MAX
      A constant holding the maximum value an unsigned byte can have as UByte, 28-1.
      static short MAX_VALUE
      A constant holding the maximum value an unsigned byte can have, 28-1.
      static UByte MIN
      A constant holding the minimum value an unsigned byte can have as UByte, 0.
      static short MIN_VALUE
      A constant holding the minimum value an unsigned byte can have, 0.
    • Field Detail

      • MIN_VALUE

        public static final short MIN_VALUE
        A constant holding the minimum value an unsigned byte can have, 0.
        See Also:
        Constant Field Values
      • MAX_VALUE

        public static final short MAX_VALUE
        A constant holding the maximum value an unsigned byte can have, 28-1.
        See Also:
        Constant Field Values
      • MIN

        public static final UByte MIN
        A constant holding the minimum value an unsigned byte can have as UByte, 0.
      • MAX

        public static final UByte MAX
        A constant holding the maximum value an unsigned byte can have as UByte, 28-1.
    • Method Detail

      • valueOf

        public static UByte valueOf​(java.lang.String value)
                             throws java.lang.NumberFormatException
        Get an instance of an unsigned byte
        Throws:
        java.lang.NumberFormatException - If value does not contain a parsable unsigned byte.
      • valueOf

        public static UByte valueOf​(byte value)
        Get an instance of an unsigned byte by masking it with 0xFF i.e. (byte) -1 becomes (ubyte) 255
      • valueOf

        public static UByte valueOf​(short value)
                             throws java.lang.NumberFormatException
        Get an instance of an unsigned byte
        Throws:
        java.lang.NumberFormatException - If value is not in the range of an unsigned byte
      • valueOf

        public static UByte valueOf​(int value)
                             throws java.lang.NumberFormatException
        Get an instance of an unsigned byte
        Throws:
        java.lang.NumberFormatException - If value is not in the range of an unsigned byte
      • valueOf

        public static UByte valueOf​(long value)
                             throws java.lang.NumberFormatException
        Get an instance of an unsigned byte
        Throws:
        java.lang.NumberFormatException - If value is not in the range of an unsigned byte
      • intValue

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

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

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

        public double doubleValue()
        Specified by:
        doubleValue in class java.lang.Number
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • compareTo

        public int compareTo​(UByte o)
        Specified by:
        compareTo in interface java.lang.Comparable<UByte>
      • toBigInteger

        public java.math.BigInteger toBigInteger()
        Description copied from class: UNumber
        Get this number as a BigInteger. This is a convenience method for calling new BigInteger(toString())
        Overrides:
        toBigInteger in class UNumber
      • add

        public UByte add​(UByte val)
                  throws java.lang.NumberFormatException
        Throws:
        java.lang.NumberFormatException
      • add

        public UByte add​(int val)
                  throws java.lang.NumberFormatException
        Throws:
        java.lang.NumberFormatException
      • subtract

        public UByte subtract​(int val)