- java.lang.Object
-
- java.lang.Number
-
- org.jooq.types.UNumber
-
- org.jooq.types.UShort
-
- All Implemented Interfaces:
Serializable
,Comparable<UShort>
public final class UShort extends UNumber implements Comparable<UShort>
Theunsigned short
type- Author:
- Lukas Eder, Jens Nerche
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static UShort
MAX
A constant holding the maximum value anunsigned short
can have as UShort, 216-1.static int
MAX_VALUE
A constant holding the maximum value anunsigned short
can have, 216-1.static UShort
MIN
A constant holding the minimum value anunsigned short
can have as UShort, 0.static int
MIN_VALUE
A constant holding the minimum value anunsigned short
can have, 0.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description UShort
add(int val)
UShort
add(UShort val)
int
compareTo(UShort o)
double
doubleValue()
boolean
equals(Object obj)
float
floatValue()
int
hashCode()
int
intValue()
long
longValue()
UShort
subtract(int val)
UShort
subtract(UShort val)
BigInteger
toBigInteger()
Get this number as aBigInteger
.String
toString()
static UShort
valueOf(int value)
Create anunsigned short
static UShort
valueOf(short value)
Create anunsigned short
by masking it with0xFFFF
i.e.static UShort
valueOf(String value)
Create anunsigned short
-
Methods inherited from class java.lang.Number
byteValue, shortValue
-
-
-
-
Field Detail
-
MIN_VALUE
public static final int MIN_VALUE
A constant holding the minimum value anunsigned short
can have, 0.- See Also:
- Constant Field Values
-
MAX_VALUE
public static final int MAX_VALUE
A constant holding the maximum value anunsigned short
can have, 216-1.- See Also:
- Constant Field Values
-
MIN
public static final UShort MIN
A constant holding the minimum value anunsigned short
can have as UShort, 0.
-
MAX
public static final UShort MAX
A constant holding the maximum value anunsigned short
can have as UShort, 216-1.
-
-
Method Detail
-
valueOf
public static UShort valueOf(String value) throws NumberFormatException
Create anunsigned short
- Throws:
NumberFormatException
- Ifvalue
does not contain a parsableunsigned short
.
-
valueOf
public static UShort valueOf(short value)
Create anunsigned short
by masking it with0xFFFF
i.e.(short) -1
becomes(ushort) 65535
-
valueOf
public static UShort valueOf(int value) throws NumberFormatException
Create anunsigned short
- Throws:
NumberFormatException
- Ifvalue
is not in the range of anunsigned short
-
floatValue
public float floatValue()
- Specified by:
floatValue
in classNumber
-
doubleValue
public double doubleValue()
- Specified by:
doubleValue
in classNumber
-
toBigInteger
public BigInteger toBigInteger()
Description copied from class:UNumber
Get this number as aBigInteger
. This is a convenience method for callingnew BigInteger(toString())
- Overrides:
toBigInteger
in classUNumber
-
compareTo
public int compareTo(UShort o)
- Specified by:
compareTo
in interfaceComparable<UShort>
-
add
public UShort add(UShort val) throws NumberFormatException
- Throws:
NumberFormatException
-
add
public UShort add(int val) throws NumberFormatException
- Throws:
NumberFormatException
-
subtract
public UShort subtract(int val)
-
-