Class UInteger

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

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

      • MIN_VALUE

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

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

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

        public static final UInteger MAX
        A constant holding the maximum value an unsigned int can have as UInteger, 232-1.
    • Method Detail

      • valueOf

        public static UInteger valueOf​(java.lang.String value)
                                throws java.lang.NumberFormatException
        Create an unsigned int
        Throws:
        java.lang.NumberFormatException - If value does not contain a parsable unsigned int.
      • valueOf

        public static UInteger valueOf​(int value)
        Create an unsigned int by masking it with 0xFFFFFFFF i.e. (int) -1 becomes (uint) 4294967295
      • valueOf

        public static UInteger valueOf​(long value)
                                throws java.lang.NumberFormatException
        Create an unsigned int
        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
      • 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
      • 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​(UInteger o)
        Specified by:
        compareTo in interface java.lang.Comparable<UInteger>
      • add

        public UInteger add​(int val)
      • subtract

        public UInteger subtract​(int val)