Class UnsignedLong

java.lang.Object
java.lang.Number
com.clickhouse.data.value.UnsignedLong
All Implemented Interfaces:
Serializable, Comparable<UnsignedLong>

public final class UnsignedLong extends Number implements Comparable<UnsignedLong>
A wrapper class for unsigned long.
See Also:
  • Field Details

  • Method Details

    • valueOf

      public static UnsignedLong valueOf(long l)
      Returns a UnsignedLong instance representing the specified long value.
      Parameters:
      l - a long value
      Returns:
      a UnsignedLong instance representing l
    • valueOf

      public static UnsignedLong valueOf(BigInteger val)
      Returns a UnsignedLong instance representing the specified BigInteger value.
      Parameters:
      val - a BigInteger value, null is treated as zero
      Returns:
      a UnsignedLong instance representing val
    • valueOf

      public static UnsignedLong valueOf(String s)
      Returns a UnsignedLong object holding the value of the specified String.
      Parameters:
      s - non-empty string
      Returns:
      a UnsignedLong instance representing s
    • valueOf

      public static UnsignedLong valueOf(String s, int radix)
      Returns a UnsignedLong object holding the value extracted from the specified String when parsed with the radix given by the second argument.
      Parameters:
      s - the String containing the unsigned integer representation to be parsed
      radix - the radix to be used while parsing s
      Returns:
      the unsigned long represented by the string argument in the specified radix
      Throws:
      NumberFormatException - if the String does not contain a parsable long
    • add

      public UnsignedLong add(UnsignedLong val)
      Returns an UnsignedLong whose value is (this + val). If the result would have more than 64 bits, returns the low 64 bits of the result.
      Parameters:
      val - value to be added to this unsigned long, null is treated as zero
      Returns:
      this + val
    • subtract

      public UnsignedLong subtract(UnsignedLong val)
      Returns an UnsignedLong whose value is (this - val). If the result would have more than 64 bits, returns the low 64 bits of the result.
      Parameters:
      val - value to be subtracted from this unsigned long, null is treated as zero
      Returns:
      this - val
    • multiply

      public UnsignedLong multiply(UnsignedLong val)
      Returns an UnsignedLong whose value is (this * val). If the result would have more than 64 bits, returns the low 64 bits of the result.
      Parameters:
      val - value to be multiplied by this unsigned long, null is treated as zero
      Returns:
      this * val
    • divide

      public UnsignedLong divide(UnsignedLong val)
      Returns an UnsignedLong whose value is (this / val).
      Parameters:
      val - value by which this unsigned is to be divided, null is treated as zero
      Returns:
      this / val
      Throws:
      ArithmeticException - if val is null or zero.
    • remainder

      public UnsignedLong remainder(UnsignedLong val)
      Returns an UnsignedLong whose value is (this % val).
      Parameters:
      val - value by which this unsigned long is to be divided, and the remainder computed
      Returns:
      this % val
      Throws:
      ArithmeticException - if val is null or zero.
    • intValue

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

      public long longValue()
      Specified by:
      longValue in class Number
    • bigIntegerValue

      public BigInteger bigIntegerValue()
      Returns the value of this UnsignedLong as a BigInteger.
      Returns:
      a BigInteger representing the unsigned long value
    • floatValue

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

      public double doubleValue()
      Specified by:
      doubleValue in class Number
    • compareTo

      public int compareTo(UnsignedLong o)
      Specified by:
      compareTo in interface Comparable<UnsignedLong>
    • hashCode

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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toString

      public String toString(int radix)
      Returns a string representation of the first argument as an unsigned integer value in the radix specified by the second argument.
      Parameters:
      radix - the radix to use in the string representation
      Returns:
      an unsigned string representation of the argument in the specified radix