Class UnsignedByte

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

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

  • Method Details

    • toString

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

      public static UnsignedByte valueOf(byte b)
      Returns a UnsignedByte instance representing the specified byte value.
      Parameters:
      b - a byte value
      Returns:
      a UnsignedByte instance representing l
    • valueOf

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

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

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

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

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

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