Class UnsignedShort

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

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

  • Method Details

    • toString

      public static String toString(short s)
      Returns a String object representing the specified unsigned short.
      Parameters:
      s - an unsigned short to be converted
      Returns:
      a string representation of the argument in base 10
    • valueOf

      public static UnsignedShort valueOf(short s)
      Returns a UnsignedShort instance representing the specified short value.
      Parameters:
      s - a short value
      Returns:
      a UnsignedShort instance representing l
    • valueOf

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

      public static UnsignedShort valueOf(String s, int radix)
      Returns a UnsignedShort 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 short represented by the string argument in the specified radix
      Throws:
      NumberFormatException - if the String does not contain a parsable short
    • add

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

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

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

      public UnsignedShort divide(UnsignedShort val)
      Returns an UnsignedShort 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 UnsignedShort remainder(UnsignedShort val)
      Returns an UnsignedShort whose value is (this % val).
      Parameters:
      val - value by which this unsigned short 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(UnsignedShort o)
      Specified by:
      compareTo in interface Comparable<UnsignedShort>
    • 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