Class ULong

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

    public final class ULong
    extends UNumber
    implements java.lang.Comparable<ULong>
    The unsigned long type
    Author:
    Lukas Eder, Jens Nerche, Ivan Sokolov
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static ULong MAX
      A constant holding the maximum value + 1 an signed long can have as ULong, 263.
      static java.math.BigInteger MAX_VALUE
      A constant holding the maximum value an unsigned long can have, 264-1.
      static java.math.BigInteger MAX_VALUE_LONG
      A constant holding the maximum value + 1 an signed long can have, 263.
      static ULong MIN
      A constant holding the minimum value an unsigned long can have as ULong, 0.
      static java.math.BigInteger MIN_VALUE
      A constant holding the minimum value an unsigned long can have, 0.
    • Field Detail

      • MIN_VALUE

        public static final java.math.BigInteger MIN_VALUE
        A constant holding the minimum value an unsigned long can have, 0.
      • MAX_VALUE

        public static final java.math.BigInteger MAX_VALUE
        A constant holding the maximum value an unsigned long can have, 264-1.
      • MAX_VALUE_LONG

        public static final java.math.BigInteger MAX_VALUE_LONG
        A constant holding the maximum value + 1 an signed long can have, 263.
      • MIN

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

        public static final ULong MAX
        A constant holding the maximum value + 1 an signed long can have as ULong, 263.
    • Method Detail

      • valueOf

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

        public static ULong valueOf​(long value)
        Create an unsigned long by masking it with 0xFFFFFFFFFFFFFFFF i.e. (long) -1 becomes (uint) 18446744073709551615
      • valueOf

        public static ULong valueOf​(java.math.BigInteger value)
                             throws java.lang.NumberFormatException
        Create an unsigned long
        Throws:
        java.lang.NumberFormatException - If value is not in the range of an unsigned long
      • compare

        public static int compare​(long x,
                                  long y)
      • 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​(ULong o)
        Specified by:
        compareTo in interface java.lang.Comparable<ULong>
      • add

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

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

        public ULong add​(long val)
                  throws java.lang.NumberFormatException
        Throws:
        java.lang.NumberFormatException
      • subtract

        public ULong subtract​(int val)
      • subtract

        public ULong subtract​(long val)