java.lang.Object
java.lang.Number
org.joou.UNumber
org.joou.UShort
- All Implemented Interfaces:
Serializable
,Comparable<UShort>
The
unsigned short
type- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final UShort
A constant holding the maximum value anunsigned short
can have as UShort, 216-1.static final int
A constant holding the maximum value anunsigned short
can have, 216-1.static final UShort
A constant holding the minimum value anunsigned short
can have as UShort, 0.static final int
A constant holding the minimum value anunsigned short
can have, 0.private static final long
Generated UIDprivate final int
The value modelling the content of thisunsigned short
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd
(int val) int
double
boolean
float
int
hashCode()
int
intValue()
long
private void
subtract
(int val) Get this number as aBigInteger
.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
Create anunsigned short
Methods inherited from class java.lang.Number
byteValue, shortValue
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDGenerated UID- See Also:
-
MIN_VALUE
public static final int MIN_VALUEA constant holding the minimum value anunsigned short
can have, 0.- See Also:
-
MAX_VALUE
public static final int MAX_VALUEA constant holding the maximum value anunsigned short
can have, 216-1.- See Also:
-
MIN
A constant holding the minimum value anunsigned short
can have as UShort, 0. -
MAX
A constant holding the maximum value anunsigned short
can have as UShort, 216-1. -
value
private final int valueThe value modelling the content of thisunsigned short
-
-
Constructor Details
-
UShort
Create anunsigned short
- Throws:
NumberFormatException
- Ifvalue
is not in the range of anunsigned short
-
UShort
private UShort(short value) Create anunsigned short
by masking it with0xFFFF
i.e.(short) -1
becomes(ushort) 65535
-
UShort
Create anunsigned short
- Throws:
NumberFormatException
- Ifvalue
does not contain a parsableunsigned short
.
-
-
Method Details
-
valueOf
Create anunsigned short
- Throws:
NumberFormatException
- Ifvalue
does not contain a parsableunsigned short
.
-
valueOf
Create anunsigned short
by masking it with0xFFFF
i.e.(short) -1
becomes(ushort) 65535
-
valueOf
Create anunsigned short
- Throws:
NumberFormatException
- Ifvalue
is not in the range of anunsigned short
-
rangeCheck
- Throws:
NumberFormatException
-
intValue
public int intValue() -
longValue
public long longValue() -
floatValue
public float floatValue()- Specified by:
floatValue
in classNumber
-
doubleValue
public double doubleValue()- Specified by:
doubleValue
in classNumber
-
toBigInteger
Description copied from class:UNumber
Get this number as aBigInteger
. This is a convenience method for callingnew BigInteger(toString())
- Overrides:
toBigInteger
in classUNumber
-
hashCode
public int hashCode() -
equals
-
toString
-
compareTo
- Specified by:
compareTo
in interfaceComparable<UShort>
-
add
- Throws:
NumberFormatException
-
add
- Throws:
NumberFormatException
-
subtract
-
subtract
-