public class ULong extends java.lang.Number implements java.lang.Comparable<ULong>
Modifier and Type | Field and Description |
---|---|
static long |
MAX_VALUE
The maximum value that a ULong may represent: 263-1.
|
static long |
MIN_VALUE
The minimum value that a ULong may represent: 0.
|
static ULong |
ZERO |
Constructor and Description |
---|
ULong(byte value)
Constructs a newly allocated
ULong object that
represents the specified byte value. |
ULong(int value)
Constructs a newly allocated
ULong object that
represents the specified int value. |
ULong(long value) |
ULong(short value)
Constructs a newly allocated
ULong object that
represents the specified short value. |
ULong(java.lang.String s)
Constructs a newly allocated
ULong object that
represents the ULong value indicated by the
String parameter. |
Modifier and Type | Method and Description |
---|---|
byte |
byteValue()
Returns the value of this
ULong as a
byte . |
static int |
compare(ULong x,
ULong y)
Compares two
ULong values numerically. |
int |
compareTo(ULong anotherULong)
Compares two
ULong objects numerically. |
double |
doubleValue()
Returns the value of this
ULong as a double
after a widening primitive conversion. |
boolean |
equals(java.lang.Object obj)
Compares this object to the specified object.
|
float |
floatValue()
Returns the value of this
ULong as a float after
a widening primitive conversion. |
int |
hashCode()
Returns a hash code for this
ULong ; equal to the result
of invoking intValue() . |
int |
intValue()
Returns the value of this
ULong as an int after
a widening primitive conversion. |
long |
longValue()
Returns the value of this
ULong as a long after
a widening primitive conversion. |
static ULong |
parseULong(java.lang.String s)
Parses the string argument as an unsigned Long
ULong . |
short |
shortValue()
Returns the value of this
ULong as a short after
a widening primitive conversion. |
java.lang.String |
toString()
Returns a
String object representing this
ULong 's value. |
static java.lang.String |
toString(ULong b)
Returns a new
String object representing the
specified ULong . |
static ULong |
valueOf(byte b)
Returns a
ULong instance representing the specified
byte value. |
static ULong |
valueOf(int b)
Returns a
ULong instance representing the specified
int value. |
static ULong |
valueOf(long b)
Returns a
ULong instance representing the specified
long value. |
static ULong |
valueOf(short b) |
static ULong |
valueOf(java.lang.String s)
Returns a
ULong object holding the value
given by the specified String . |
public static final long MIN_VALUE
public static final long MAX_VALUE
public static final ULong ZERO
public ULong(byte value)
ULong
object that
represents the specified byte
value.value
- the value to be represented by the
ULong
.public ULong(short value)
ULong
object that
represents the specified short
value.value
- the value to be represented by the
ULong
.public ULong(int value)
ULong
object that
represents the specified int
value.value
- the value to be represented by the
int
.public ULong(long value)
value
- public ULong(java.lang.String s)
ULong
object that
represents the ULong
value indicated by the
String
parameter. The string is converted to a
ULong
value in exactly the manner used by the
parseInt
method.s
- the String
to be converted to a
ULong
java.lang.NumberFormatException
- If the String
does not contain a parsable long
.public static java.lang.String toString(ULong b)
String
object representing the
specified ULong
.b
- the ULong
to be convertedULong
public static ULong valueOf(byte b)
ULong
instance representing the specified
byte
value.
If a new ULong
instance is not required, this method
should generally be used in preference to the constructor
ULong(byte)
, as this method is likely to yield
significantly better space and time performance since
all byte values are cached.b
- a byte value.ULong
instance representing b
.public static ULong valueOf(short b)
b
- public static ULong valueOf(int b)
ULong
instance representing the specified
int
value.b
- a byte value.ULong
instance representing b
.public static ULong valueOf(long b)
ULong
instance representing the specified
long
value.b
- a long value.ULong
instance representing b
.public static ULong parseULong(java.lang.String s) throws java.lang.NumberFormatException
ULong
.s
- a String
containing the
ULong
representation to be parsedULong
value represented by the
argument in the stringjava.lang.NumberFormatException
- if the string does not
contain a parsable ULong
.public static ULong valueOf(java.lang.String s) throws java.lang.NumberFormatException
ULong
object holding the value
given by the specified String
.s
- the string to be parsedULong
object holding the value
represented by the string argumentjava.lang.NumberFormatException
- If the String
does
not contain a parsable ULong
.public byte byteValue()
ULong
as a
byte
.byteValue
in class java.lang.Number
public short shortValue()
ULong
as a short
after
a widening primitive conversion.shortValue
in class java.lang.Number
public int intValue()
ULong
as an int
after
a widening primitive conversion.intValue
in class java.lang.Number
public long longValue()
ULong
as a long
after
a widening primitive conversion.longValue
in class java.lang.Number
public float floatValue()
ULong
as a float
after
a widening primitive conversion.floatValue
in class java.lang.Number
public double doubleValue()
ULong
as a double
after a widening primitive conversion.doubleValue
in class java.lang.Number
public java.lang.String toString()
String
object representing this
ULong
's value.toString
in class java.lang.Object
public int hashCode()
ULong
; equal to the result
of invoking intValue()
.hashCode
in class java.lang.Object
ULong
public boolean equals(java.lang.Object obj)
true
if and only if the argument is not
null
and is a ULong
object that
contains the same int
value as this object.equals
in class java.lang.Object
obj
- the object to compare withtrue
if the objects are the same;
false
otherwise.public int compareTo(ULong anotherULong)
ULong
objects numerically.compareTo
in interface java.lang.Comparable<ULong>
anotherULong
- the ULong
to be compared.0
if this ULong
is
equal to the argument ULong
; a value less than
0
if this ULong
is numerically less
than the argument ULong
; and a value greater than
0
if this ULong
is numerically
greater than the argument ULong
(signed
comparison).public static int compare(ULong x, ULong y)
ULong
values numerically.
The value returned is identical to what would be returned by:
ULong.valueOf(x).compareTo(ULong.valueOf(y))
x
- the first ULong
to comparey
- the second ULong
to compare0
if x == y
;
a value less than 0
if x < y
; and
a value greater than 0
if x > y