Package com.clickhouse.data.value
Class UnsignedShort
java.lang.Object
java.lang.Number
com.clickhouse.data.value.UnsignedShort
- All Implemented Interfaces:
Serializable,Comparable<UnsignedShort>
A wrapper class for unsigned
short.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final UnsignedShortstatic final UnsignedShortstatic final UnsignedShortstatic final UnsignedShort -
Method Summary
Modifier and TypeMethodDescriptionadd(UnsignedShort val) Returns anUnsignedShortwhose value is(this + val).intdivide(UnsignedShort val) Returns anUnsignedShortwhose value is(this / val).doublebooleanfloatinthashCode()intintValue()longmultiply(UnsignedShort val) Returns anUnsignedShortwhose value is(this * val).remainder(UnsignedShort val) Returns anUnsignedShortwhose value is(this % val).subtract(UnsignedShort val) Returns anUnsignedShortwhose value is(this - val).toString()toString(int radix) Returns a string representation of the first argument as an unsigned integer value in the radix specified by the second argument.static StringtoString(short s) Returns aStringobject representing the specified unsigned short.static UnsignedShortvalueOf(short s) Returns aUnsignedShortinstance representing the specifiedshortvalue.static UnsignedShortReturns aUnsignedShortobject holding the value of the specifiedString.static UnsignedShortReturns aUnsignedShortobject holding the value extracted from the specifiedStringwhen parsed with the radix given by the second argument.Methods inherited from class java.lang.Number
byteValue, shortValue
-
Field Details
-
BYTES
public static final int BYTES- See Also:
-
ZERO
-
ONE
-
MIN_VALUE
-
MAX_VALUE
-
-
Method Details
-
toString
Returns aStringobject representing the specified unsigned short.- Parameters:
s- an unsigned short to be converted- Returns:
- a string representation of the argument in base 10
-
valueOf
Returns aUnsignedShortinstance representing the specifiedshortvalue.- Parameters:
s- a short value- Returns:
- a
UnsignedShortinstance representingl
-
valueOf
Returns aUnsignedShortobject holding the value of the specifiedString.- Parameters:
s- non-empty string- Returns:
- a
UnsignedShortinstance representings
-
valueOf
Returns aUnsignedShortobject holding the value extracted from the specifiedStringwhen parsed with the radix given by the second argument.- Parameters:
s- theStringcontaining the unsigned integer representation to be parsedradix- the radix to be used while parsings- Returns:
- the unsigned
shortrepresented by the string argument in the specified radix - Throws:
NumberFormatException- if theStringdoes not contain a parsableshort
-
add
Returns anUnsignedShortwhose 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
Returns anUnsignedShortwhose 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
Returns anUnsignedShortwhose 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
Returns anUnsignedShortwhose 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- ifvalis null or zero.
-
remainder
Returns anUnsignedShortwhose 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- ifvalis null or zero.
-
intValue
public int intValue() -
longValue
public long longValue() -
floatValue
public float floatValue()- Specified by:
floatValuein classNumber
-
doubleValue
public double doubleValue()- Specified by:
doubleValuein classNumber
-
compareTo
- Specified by:
compareToin interfaceComparable<UnsignedShort>
-
hashCode
public int hashCode() -
equals
-
toString
-
toString
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
-