Class UShort
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 UShortA constant holding the maximum value anunsigned shortcan have as UShort, 216-1.static final intA constant holding the maximum value anunsigned shortcan have, 216-1.static final UShortA constant holding the minimum value anunsigned shortcan have as UShort, 0.static final intA constant holding the minimum value anunsigned shortcan have, 0.private static final longGenerated UIDprivate final intThe value modelling the content of thisunsigned short -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionadd(int val) intdoublebooleanfloatinthashCode()intintValue()longprivate voidsubtract(int val) Get this number as aBigInteger.toString()static UShortvalueOf(int value) Create anunsigned shortstatic UShortvalueOf(short value) Create anunsigned shortby masking it with0xFFFFi.e.static UShortCreate anunsigned shortMethods inherited from class 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 shortcan have, 0.- See Also:
-
MAX_VALUE
public static final int MAX_VALUEA constant holding the maximum value anunsigned shortcan have, 216-1.- See Also:
-
MIN
A constant holding the minimum value anunsigned shortcan have as UShort, 0. -
MAX
A constant holding the maximum value anunsigned shortcan 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- Ifvalueis not in the range of anunsigned short
-
UShort
private UShort(short value) Create anunsigned shortby masking it with0xFFFFi.e.(short) -1becomes(ushort) 65535 -
UShort
Create anunsigned short- Throws:
NumberFormatException- Ifvaluedoes not contain a parsableunsigned short.
-
-
Method Details
-
valueOf
Create anunsigned short- Throws:
NumberFormatException- Ifvaluedoes not contain a parsableunsigned short.
-
valueOf
Create anunsigned shortby masking it with0xFFFFi.e.(short) -1becomes(ushort) 65535 -
valueOf
Create anunsigned short- Throws:
NumberFormatException- Ifvalueis not in the range of anunsigned short
-
rangeCheck
- Throws:
NumberFormatException
-
intValue
-
longValue
-
floatValue
public float floatValue()- Specified by:
floatValuein classNumber
-
doubleValue
public double doubleValue()- Specified by:
doubleValuein classNumber
-
toBigInteger
Description copied from class:UNumberGet this number as aBigInteger. This is a convenience method for callingnew BigInteger(toString())- Overrides:
toBigIntegerin classUNumber
-
hashCode
-
equals
-
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<UShort>
-
add
- Throws:
NumberFormatException
-
add
- Throws:
NumberFormatException
-
subtract
-
subtract
-