java.io.Serializable
, java.lang.Comparable<UShort>
public final class UShort extends UNumber implements java.lang.Comparable<UShort>
unsigned short
typeModifier and Type | Field | Description |
---|---|---|
static UShort |
MAX |
A constant holding the maximum value an
unsigned short can
have as UShort, 216-1. |
static int |
MAX_VALUE |
A constant holding the maximum value an
unsigned short can
have, 216-1. |
static UShort |
MIN |
A constant holding the minimum value an
unsigned short can
have as UShort, 0. |
static int |
MIN_VALUE |
A constant holding the minimum value an
unsigned short can
have, 0. |
Modifier and Type | Method | Description |
---|---|---|
UShort |
add(int val) |
|
UShort |
add(UShort val) |
|
int |
compareTo(UShort o) |
|
double |
doubleValue() |
|
boolean |
equals(java.lang.Object obj) |
|
float |
floatValue() |
|
int |
hashCode() |
|
int |
intValue() |
|
long |
longValue() |
|
UShort |
subtract(int val) |
|
UShort |
subtract(UShort val) |
|
java.math.BigInteger |
toBigInteger() |
Get this number as a
BigInteger . |
java.lang.String |
toString() |
|
static UShort |
valueOf(int value) |
Create an
unsigned short |
static UShort |
valueOf(short value) |
Create an
unsigned short by masking it with
0xFFFF i.e. |
static UShort |
valueOf(java.lang.String value) |
Create an
unsigned short |
public static final int MIN_VALUE
unsigned short
can
have, 0.public static final int MAX_VALUE
unsigned short
can
have, 216-1.public static final UShort MIN
unsigned short
can
have as UShort, 0.public static final UShort MAX
unsigned short
can
have as UShort, 216-1.public static UShort valueOf(java.lang.String value) throws java.lang.NumberFormatException
unsigned short
java.lang.NumberFormatException
- If value
does not contain a
parsable unsigned short
.public static UShort valueOf(short value)
unsigned short
by masking it with
0xFFFF
i.e. (short) -1
becomes
(ushort) 65535
public static UShort valueOf(int value) throws java.lang.NumberFormatException
unsigned short
java.lang.NumberFormatException
- If value
is not in the range
of an unsigned short
public int intValue()
intValue
in class java.lang.Number
public long longValue()
longValue
in class java.lang.Number
public float floatValue()
floatValue
in class java.lang.Number
public double doubleValue()
doubleValue
in class java.lang.Number
public java.math.BigInteger toBigInteger()
UNumber
BigInteger
. This is a convenience method for
calling new BigInteger(toString())
toBigInteger
in class UNumber
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(UShort o)
compareTo
in interface java.lang.Comparable<UShort>
public UShort add(UShort val) throws java.lang.NumberFormatException
java.lang.NumberFormatException
public UShort add(int val) throws java.lang.NumberFormatException
java.lang.NumberFormatException
public UShort subtract(int val)
Copyright © 2018. All rights reserved.