|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Number
com.sun.jdmk.UnsignedLong
public class UnsignedLong
An unsigned integer, between 0 and 264 - 1. Objects of this class and its subclasses are immutable.
Field Summary | |
---|---|
static UnsignedLong |
MAX_VALUE
The largest representable UnsignedLong value,
equal to 264 - 1. |
Constructor Summary | |
---|---|
UnsignedLong(long value)
Deprecated. Use make(long) instead. |
Method Summary | |
---|---|
UnsignedLong |
add(UnsignedLong x)
Return an UnsignedLong that is equal mod
264 to this + x . |
UnsignedLong |
and(UnsignedLong x)
Return an UnsignedLong that is the bitwise
and of this and x . |
UnsignedLong |
clearBit(int n)
Return an UnsignedLong that has the designated
bit clear. |
int |
compareTo(long x)
Returns a value that is negative, zero, or positive according as the value represented by this is respectively less
than, equal to, or greater to x . |
int |
compareTo(Object o)
|
static UnsignedLong |
decode(String s)
Return an UnsignedLong whose value is specified by the
given String, including a possible prefix indicating the radix. |
UnsignedLong |
divide(UnsignedLong x)
Return an UnsignedLong that is equal to
[this / x] , where [x] is the floor
function. |
double |
doubleValue()
Return the representable double that is nearest
to this unsigned number. |
boolean |
equals(Object o)
|
float |
floatValue()
Return the representable float that is nearest
to this unsigned number. |
int |
hashCode()
|
int |
intValue()
Return an int that is equal mod 232 to
this unsigned number. |
long |
longValue()
Return a long that is equal mod 264 to
this unsigned number. |
static UnsignedLong |
make(long x)
Make an UnsignedLong object representing a value
between 0 and 264 that is equal mod
264 to x . |
UnsignedLong |
max(UnsignedLong x)
Return the larger of this and x . |
UnsignedLong |
min(UnsignedLong x)
Return the smaller of this and x . |
UnsignedLong |
mod(UnsignedLong x)
Return an UnsignedLong that is equal to
this mod x . |
UnsignedLong |
multiply(UnsignedLong x)
Return an UnsignedLong that is equal mod
264 to this * x . |
UnsignedLong |
not()
Return an UnsignedLong that is the bitwise
not of this , equal to
264 - 1 - this . |
UnsignedLong |
or(UnsignedLong x)
Return an UnsignedLong that is the bitwise
or of this and x . |
UnsignedLong |
setBit(int n)
Return an UnsignedLong that has the designated
bit set. |
UnsignedLong |
shiftLeft(int n)
Return an UnsignedLong that is equal mod
264 to [this * 2n] , where
[x] is the floor function. |
UnsignedLong |
shiftRight(int n)
Return an UnsignedLong that is equal mod
264 to [this / 2n] , where
[x] is the floor function. |
UnsignedLong |
subtract(UnsignedLong x)
Return an UnsignedLong that is equal mod
264 to this - x . |
boolean |
testBit(int n)
Return true if and only if the bit representing 2n is set in this . |
static String |
toBinaryString(UnsignedLong u)
Return a String that is the binary representation of this unsigned number, without extra leading zeroes. |
static String |
toHexString(UnsignedLong u)
Return a String that is the hexadecimal representation of this unsigned number, without extra leading zeroes. |
static String |
toOctalString(UnsignedLong u)
Return a String that is the octal representation of this unsigned number, without extra leading zeroes. |
String |
toString()
Return a String that is the decimal representation of this unsigned number. |
static UnsignedLong |
valueOf(String s)
Return an UnsignedLong whose value is specified by the
given String in decimal. |
static UnsignedLong |
valueOf(String s,
int radix)
Return an UnsignedLong whose value is specified by the
given String in the given radix. |
UnsignedLong |
xor(UnsignedLong x)
Return an UnsignedLong that is the bitwise
xor of this and x . |
Methods inherited from class java.lang.Number |
---|
byteValue, shortValue |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final UnsignedLong MAX_VALUE
UnsignedLong
value,
equal to 264 - 1.
Constructor Detail |
---|
public UnsignedLong(long value)
make(long)
instead.
value
.
Method Detail |
---|
public static UnsignedLong make(long x)
UnsignedLong
object representing a value
between 0 and 264 that is equal mod
264 to x
.
public int intValue()
int
that is equal mod 232 to
this unsigned number.
intValue
in class Number
public long longValue()
long
that is equal mod 264 to
this unsigned number.
longValue
in class Number
public double doubleValue()
double
that is nearest
to this unsigned number.
doubleValue
in class Number
public float floatValue()
float
that is nearest
to this unsigned number.
floatValue
in class Number
public int compareTo(Object o)
compareTo
in interface Comparable
public int compareTo(long x)
this
is respectively less
than, equal to, or greater to x
.
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
public static String toHexString(UnsignedLong u)
a
to f
.
Long.toHexString(long)
public static String toOctalString(UnsignedLong u)
Long.toOctalString(long)
public static String toBinaryString(UnsignedLong u)
Long.toBinaryString(long)
public static UnsignedLong valueOf(String s) throws NumberFormatException
UnsignedLong
whose value is specified by the
given String in decimal. Equivalent to valueOf(s, 10)
NumberFormatException
public static UnsignedLong valueOf(String s, int radix) throws NumberFormatException
UnsignedLong
whose value is specified by the
given String in the given radix.
s
- a String representing an unsigned integer in the
given radix. The characters in s
must all be
digits of the specified radix (as determined by whether
Character.digit
returns a nonnegative value).radix
- the radix in which the digits in s
are
expressed.
NumberFormatException
- if s
is empty,
or contains characters that are not digits of the specified
radix, or specifies a value that is >= 264, or
if the radix is not between Character.MIN_RADIX
and Character.MAX_RADIX
.public static UnsignedLong decode(String s) throws NumberFormatException
UnsignedLong
whose value is specified by the
given String, including a possible prefix indicating the radix.
If the String begins with 0x
or #
, the
remainder of the String specifies a hexadecimal number. If the
String begins with 0
followed by other digits, the
remainder of the String specifies an octal number. Otherwise,
the String specifies a decimal number.
NumberFormatException
- if s
is empty,
or contains no characters after the prefix, or contains
characters that are not digits of the specified radix, or
specifies a value that is >= 264.public UnsignedLong add(UnsignedLong x)
UnsignedLong
that is equal mod
264 to this + x
.
public UnsignedLong subtract(UnsignedLong x)
UnsignedLong
that is equal mod
264 to this - x
.
public UnsignedLong multiply(UnsignedLong x)
UnsignedLong
that is equal mod
264 to this * x
.
public UnsignedLong divide(UnsignedLong x) throws ArithmeticException
UnsignedLong
that is equal to
[this / x]
, where [x]
is the floor
function.
ArithmeticException
- if x
is zero.public UnsignedLong mod(UnsignedLong x) throws ArithmeticException
UnsignedLong
that is equal to
this mod x
.
ArithmeticException
- if x
is zero.public UnsignedLong shiftLeft(int n)
UnsignedLong
that is equal mod
264 to [this * 2n]
, where
[x]
is the floor function. n
may
be negative.
public UnsignedLong shiftRight(int n)
UnsignedLong
that is equal mod
264 to [this / 2n]
, where
[x]
is the floor function. n
may
be negative.
public UnsignedLong and(UnsignedLong x)
UnsignedLong
that is the bitwise
and
of this
and x
.
public UnsignedLong or(UnsignedLong x)
UnsignedLong
that is the bitwise
or
of this
and x
.
public UnsignedLong xor(UnsignedLong x)
UnsignedLong
that is the bitwise
xor
of this
and x
.
public UnsignedLong not()
UnsignedLong
that is the bitwise
not
of this
, equal to
264 - 1 - this
.
public boolean testBit(int n)
2n
is set in this
.
public UnsignedLong setBit(int n)
UnsignedLong
that has the designated
bit set.
This means that the bitwise or
of
this
and 2n
.
public UnsignedLong clearBit(int n)
UnsignedLong
that has the designated
bit clear.
This means the bitwise and
of
this
and 264 - 1 - n
.
public UnsignedLong min(UnsignedLong x)
this
and x
.
public UnsignedLong max(UnsignedLong x)
this
and x
.
|
Open Source build 02 opendmk-1.0-b02 2007.10.01_19:17:46_MEST |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |