Class UnsignedInteger

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

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

  • Method Details

    • valueOf

      public static UnsignedInteger valueOf(int i)
      Returns a UnsignedInteger instance representing the specified int value.
      Parameters:
      i - an int value
      Returns:
      a UnsignedInteger instance representing l
    • valueOf

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

      public static UnsignedInteger valueOf(String s, int radix)
      Returns a UnsignedInteger 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 int
    • add

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

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

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

      public UnsignedInteger divide(UnsignedInteger val)
      Returns an UnsignedInteger 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 UnsignedInteger remainder(UnsignedInteger val)
      Returns an UnsignedInteger whose value is (this % val).
      Parameters:
      val - value by which this unsigned integer 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
    • floatValue

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

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

      public int compareTo(UnsignedInteger o)
      Specified by:
      compareTo in interface Comparable<UnsignedInteger>
    • 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