

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object java.lang.Number net.sf.ivmaidns.util.UnsignedLong
public final class UnsignedLong
Class for unsigned 'long' wrappers.
This class wraps a primitive unsigned long
value
(like Long
class). The class also contains
static
methods for the unsigned long
integer arithmetic: comparison, median, multiplication (simple
and modular), division, remainder, power, logarithm, factorial,
'greatest common divisor', modular inversion, conversion to/from
a byte array (in the direct and reversed orders), stream bits
writing/reading, conversion to/from a string (in some given
radix).
UnsignedInt
,
LongVector
,
ByteVector
,
PseudoRandom
,
JavaConsts
,
Serialized FormField Summary  

protected long 
unsignedValue
The wrapped (encapsulated) unsigned long value. 
Constructor Summary  

UnsignedLong(long unsignedValue)
Constructs a new object that represents the specified primitive unsigned long value. 
Method Summary  

static int 
binLog(long unsignedValue)
Returns the integer part of binary logarithm of a given unsigned value. 
java.lang.Object 
clone()
Creates and returns a copy of this object. 
static int 
compare(long unsignedA,
long unsignedB)
Compares two given unsigned integer values. 
static long 
decode(java.lang.String str,
int beginIndex,
int endIndex)
Decodes a given string region as an unsigned octal/decimal/hexadecimal integer value. 
static long 
div(long unsignedA,
long unsignedB)
Returns the result of integer division of one given unsigned value by another one. 
static long 
divHigh(long unsignedHighA,
long unsignedLowA,
long unsignedB)
Returns the highest half of the result of integer division of join of two given halves of unsigned value by another one. 
static long 
divLow(long unsignedHighA,
long unsignedLowA,
long unsignedB)
Returns the lowest half of the result of integer division of join of two given halves of unsigned value by another one. 
double 
doubleValue()
Returns the value of this number as
double . 
boolean 
equals(java.lang.Object obj)
Indicates whether this object is equal to the
specified one. 
static long 
factorial(int value)
Computes the factorial of a given value. 
float 
floatValue()
Returns the value of this number as
float . 
static long 
gcd(long unsignedA,
long unsignedB)
Computes the greatest 'common divisor' (gcd) of two given unsigned nonzero values. 
static long 
getFromByteArray(byte[] bytes,
int offset,
int len)
Converts the specified region of a given byte array into an unsigned value. 
static long 
getFromIntelArray(byte[] bytes,
int offset,
int len)
Converts the specified region of a given byte array into an unsigned value in the reversed order. 
static boolean 
greater(long unsignedA,
long unsignedB)
Tests whether the first specified unsigned integer is greater than the second one. 
static boolean 
greaterOrEqual(long unsignedA,
long unsignedB)
Tests whether the first specified unsigned integer is greater or equal to the second one. 
boolean 
greaterThan(java.lang.Object obj)
Tests for being semantically greater than the argument. 
int 
hashCode()
Returns a hash code value for the object. 
static int 
hashCode(long value)
Converts long value into its hash code value. 
int 
intValue()
Returns the value of this number as
int . 
static long 
inverseMod(long unsignedA,
long unsignedMax)
Computes the modular 'inversion' of a given unsigned value. 
long 
longValue()
Returns the value of this number as
long . 
static long 
max(long unsignedA,
long unsignedB)
Returns the maximum of two given unsigned integer values. 
static long 
median(long unsignedA,
long unsignedB,
long unsignedC)
Returns the 'median' (middle value) of three given unsigned integer values. 
static long 
min(long unsignedA,
long unsignedB)
Returns the minimum of two given unsigned integer values. 
static long 
mulDiv(long unsignedA,
long unsignedB,
long unsignedC,
boolean roundUp)
Returns the lowest half of the result of integer division of 'long' (full) product of the first two given unsigned nonzero values by the third given unsigned nonzero value. 
static long 
mulHigh(long unsignedA,
long unsignedB)
Returns the highest half of 'long' (full) product of two given unsigned integers. 
static long 
mulLow(long unsignedA,
long unsignedB)
Returns the lowest half of 'long' (full) product of two given unsigned integers. 
static long 
mulMod(long unsignedA,
long unsignedB,
long unsignedMax)
Computes the modular 'multiplication' of two given unsigned values. 
static long 
parse(java.lang.String str,
int beginIndex,
int endIndex,
boolean isUnsigned,
int radix)
Parses a given string region as a signed/unsigned integer in the specified radix. 
static long 
power(long value,
int degree)
Returns a given value involved to the power of the specified degree. 
static void 
putToByteArray(byte[] bytes,
int offset,
long unsignedValue,
int len)
Puts a given value into the specified byte array. 
static void 
putToIntelArray(byte[] bytes,
int offset,
long unsignedValue,
int len)
Puts a given value into the specified byte array in the reversed order. 
static long 
readBits(java.io.InputStream in,
int count)
Reads a group of bits from a given input stream. 
static long 
rem(long unsignedA,
long unsignedB)
Returns the remainder of integer division of one given unsigned value by another one. 
static long 
remLow(long unsignedHighA,
long unsignedLowA,
long unsignedB)
Returns the remainder of integer division of join of two given halves of unsigned value by another one. 
static int 
signedCompare(long valueA,
long valueB)
Compares two given (signed) integer values. 
static long 
signedMedian(long valueA,
long valueB,
long valueC)
Returns the 'median' (middle value) of three given (signed) integer values. 
static java.lang.String 
toBinaryString(long unsignedValue,
int minLength)
Converts a given unsigned value into its binary string representation. 
static byte[] 
toByteArray(long unsignedValue,
int len)
Converts a given value into a byte array. 
static java.lang.String 
toHexString(long unsignedValue,
boolean upperCase,
int minLength)
Converts a given unsigned value into its hexadecimal string representation. 
static byte[] 
toIntelArray(long unsignedValue,
int len)
Converts a given value in the reversed order into a byte array. 
static java.lang.String 
toOctalString(long unsignedValue,
int minLength)
Converts a given unsigned value into its octal string representation. 
java.lang.String 
toString()
Converts this object to its 'inline' string
representation. 
static java.lang.String 
toString(long value,
boolean isUnsigned)
Converts a given signed/unsigned value into its decimal string representation. 
static java.lang.String 
toString(long value,
boolean isUnsigned,
boolean forceSign,
int radix,
boolean upperCase,
int minLength)
Converts a given signed/unsigned value into its string representation in the specified radix. 
static UnsignedLong 
valueOf(java.lang.String str)
Converts a given string to an instance of this class. 
static void 
writeBits(java.io.OutputStream out,
long unsignedValue,
int count)
Writes a group of bits to a given output stream. 
Methods inherited from class java.lang.Number 

byteValue, shortValue 
Methods inherited from class java.lang.Object 

finalize, getClass, notify, notifyAll, wait, wait, wait 
Field Detail 

protected long unsignedValue
long
value.
Important notes: this value is constant.
UnsignedLong(long)
,
valueOf(java.lang.String)
,
clone()
,
hashCode()
,
intValue()
,
longValue()
,
floatValue()
,
doubleValue()
,
equals(java.lang.Object)
,
greaterThan(java.lang.Object)
,
toString()
Constructor Detail 

public UnsignedLong(long unsignedValue)
long
value.
unsignedValue
 the unsigned value to be wrapped.valueOf(java.lang.String)
,
clone()
,
intValue()
,
longValue()
,
equals(java.lang.Object)
,
greaterThan(java.lang.Object)
,
toString()
Method Detail 

public static final int hashCode(long value)
long
value into its hash code value.
The bits of the specified value are mixed in a particular order
to produce a single int
'hash' value.
value
 the signed/unsigned value to be hashed.
hashCode()
,
intValue()
public static final boolean greater(long unsignedA, long unsignedB)
unsignedA
 the first compared unsigned value.unsignedB
 the second compared unsigned value.
true
if and only if unsignedA is greater
than unsignedB (in the unsigned manner).greaterOrEqual(long, long)
,
compare(long, long)
,
min(long, long)
,
max(long, long)
,
median(long, long, long)
,
greaterThan(java.lang.Object)
public static final boolean greaterOrEqual(long unsignedA, long unsignedB)
unsignedA
 the first compared unsigned value.unsignedB
 the second compared unsigned value.
true
if and only if unsignedA is not less
than unsignedB (in the unsigned manner).greater(long, long)
,
compare(long, long)
,
min(long, long)
,
max(long, long)
,
median(long, long, long)
,
equals(java.lang.Object)
,
greaterThan(java.lang.Object)
public static final int compare(long unsignedA, long unsignedB)
long
values.
unsignedA
 the first compared unsigned value.unsignedB
 the second compared unsigned value.
signedCompare(long, long)
,
greater(long, long)
,
greaterOrEqual(long, long)
,
min(long, long)
,
max(long, long)
,
median(long, long, long)
,
equals(java.lang.Object)
,
greaterThan(java.lang.Object)
public static final int signedCompare(long valueA, long valueB)
long
values.
valueA
 the first compared (signed) value.valueB
 the second compared (signed) value.
compare(long, long)
,
signedMedian(long, long, long)
public static final long min(long unsignedA, long unsignedB)
unsignedA
 the first unsigned value.unsignedB
 the second unsigned value.
max(long, long)
,
median(long, long, long)
,
greater(long, long)
,
greaterOrEqual(long, long)
,
compare(long, long)
public static final long max(long unsignedA, long unsignedB)
unsignedA
 the first unsigned value.unsignedB
 the second unsigned value.
min(long, long)
,
median(long, long, long)
,
greater(long, long)
,
greaterOrEqual(long, long)
,
compare(long, long)
public static final long median(long unsignedA, long unsignedB, long unsignedC)
unsignedA
 the first unsigned value.unsignedB
 the second unsigned value.unsignedC
 the third unsigned value.
signedMedian(long, long, long)
,
min(long, long)
,
max(long, long)
,
greater(long, long)
,
greaterOrEqual(long, long)
,
compare(long, long)
public static final long signedMedian(long valueA, long valueB, long valueC)
valueA
 the first (signed) value.valueB
 the second (signed) value.valueC
 the third (signed) value.
median(long, long, long)
,
signedCompare(long, long)
public static final long mulHigh(long unsignedA, long unsignedB)
unsignedA
 the first unsigned value.unsignedB
 the second unsigned value.
divHigh(long, long, long)
,
mulLow(long, long)
,
mulDiv(long, long, long, boolean)
,
mulMod(long, long, long)
,
power(long, int)
,
factorial(int)
public static final long mulLow(long unsignedA, long unsignedB)
unsignedA
 the first unsigned value.unsignedB
 the second unsigned value.
divLow(long, long, long)
,
remLow(long, long, long)
,
mulHigh(long, long)
,
mulDiv(long, long, long, boolean)
,
mulMod(long, long, long)
,
power(long, int)
,
factorial(int)
public static final long div(long unsignedA, long unsignedB) throws java.lang.ArithmeticException
unsignedA
 the first unsigned value.unsignedB
 the second unsigned value.
java.lang.ArithmeticException
 if unsignedB is 0
.mulLow(long, long)
,
rem(long, long)
,
divHigh(long, long, long)
,
divLow(long, long, long)
,
mulDiv(long, long, long, boolean)
,
gcd(long, long)
,
inverseMod(long, long)
public static final long divHigh(long unsignedHighA, long unsignedLowA, long unsignedB) throws java.lang.ArithmeticException
div(unsignedHighA, unsignedB)
.
unsignedHighA
 the top half of the first unsigned value.unsignedLowA
 the bottom half of the first unsigned value.unsignedB
 the second unsigned value.
java.lang.ArithmeticException
 if unsignedB is 0
.divLow(long, long, long)
,
mulHigh(long, long)
,
mulLow(long, long)
,
div(long, long)
,
mulDiv(long, long, long, boolean)
public static final long divLow(long unsignedHighA, long unsignedLowA, long unsignedB) throws java.lang.ArithmeticException
unsignedHighA
 the top half of the first unsigned value.unsignedLowA
 the bottom half of the first unsigned value.unsignedB
 the second unsigned value.
java.lang.ArithmeticException
 if unsignedB is 0
.divHigh(long, long, long)
,
remLow(long, long, long)
,
mulHigh(long, long)
,
mulLow(long, long)
,
div(long, long)
,
mulDiv(long, long, long, boolean)
,
gcd(long, long)
public static final long rem(long unsignedA, long unsignedB) throws java.lang.ArithmeticException
(unsignedA  div(unsignedA, unsignedB) * unsignedB)
.
unsignedA
 the first unsigned value.unsignedB
 the second unsigned value.
java.lang.ArithmeticException
 if unsignedB is 0
.mulLow(long, long)
,
div(long, long)
,
remLow(long, long, long)
,
inverseMod(long, long)
public static final long remLow(long unsignedHighA, long unsignedLowA, long unsignedB) throws java.lang.ArithmeticException
unsignedHighA
 the top half of the first unsigned value.unsignedLowA
 the bottom half of the first unsigned value.unsignedB
 the second unsigned value.
java.lang.ArithmeticException
 if unsignedB is 0
.rem(long, long)
,
divLow(long, long, long)
,
mulHigh(long, long)
,
mulLow(long, long)
,
mulMod(long, long, long)
public static final long power(long value, int degree)
0
is returned. Important notes: value may
be signed or unsigned.
value
 the signed/unsigned value to be involved to the power.degree
 the degree of the power.
mulLow(long, long)
,
binLog(long)
,
factorial(int)
public static final int binLog(long unsignedValue)
1
is
returned, else the result is in the range from 0
to
(JavaConsts LONG_SIZE  1)
, inclusive.
unsignedValue
 the unsigned argument of the logarithm.
power(long, int)
,
factorial(int)
public static final long factorial(int value)
0
is returned.
value
 the factorial argument.
mulLow(long, long)
,
power(long, int)
,
binLog(long)
public static final long gcd(long unsignedA, long unsignedB)
long
value plus one.
unsignedA
 the first unsigned value.unsignedB
 the second unsigned value.
inverseMod(long, long)
,
mulMod(long, long, long)
,
mulDiv(long, long, long, boolean)
,
binLog(long)
public static final long inverseMod(long unsignedA, long unsignedMax)
gcd(unsignedA, unsignedMax + 1) == 1
then mulMod(result, unsignedA, unsignedMax)
is
1
. The result of modular inversion is in the range
from 1
to max(unsignedMax, 1)
,
inclusive.
unsignedA
 the unsigned value to inverse.unsignedMax
 the unsigned maximum for modular multiplication.
mulMod(long, long, long)
,
gcd(long, long)
,
div(long, long)
,
rem(long, long)
public static final long mulMod(long unsignedA, long unsignedB, long unsignedMax)
0
to
unsignedMax, inclusive.
unsignedA
 the first unsigned value to multiply.unsignedB
 the second unsigned value to multiply.unsignedMax
 the unsigned maximum value for the result to have.
inverseMod(long, long)
,
gcd(long, long)
,
mulDiv(long, long, long, boolean)
,
mulHigh(long, long)
,
remLow(long, long, long)
public static final long mulDiv(long unsignedA, long unsignedB, long unsignedC, boolean roundUp)
long
value plus one.
unsignedA
 the first unsigned value.unsignedB
 the second unsigned value.unsignedC
 the unsigned divisor value.roundUp
 true
if the result of division is rounded upwards
(to the nearest greater integer value), else it is rounded
towards zero.
mulHigh(long, long)
,
mulLow(long, long)
,
divLow(long, long, long)
,
gcd(long, long)
,
mulMod(long, long, long)
,
inverseMod(long, long)
public static final void putToByteArray(byte[] bytes, int offset, long unsignedValue, int len) throws java.lang.NullPointerException, java.lang.ArrayIndexOutOfBoundsException
JavaConsts LONG_LENGTH
then unsignedValue
is zeroextended.
bytes
 the byte array (must be nonnull
) to put to.offset
 the first array index (must be in the range) to put at.unsignedValue
 the value, containing the bytes (in its lowest part) to be put.len
 the amount of bytes to put.
java.lang.NullPointerException
 if bytes is null
.
java.lang.ArrayIndexOutOfBoundsException
 if len is positive and (offset is negative
or is greater than length
of bytes minus
len).toByteArray(long, int)
,
getFromByteArray(byte[], int, int)
,
putToIntelArray(byte[], int, long, int)
,
writeBits(java.io.OutputStream, long, int)
public static final byte[] toByteArray(long unsignedValue, int len)
JavaConsts LONG_LENGTH
then unsignedValue
is zeroextended.
unsignedValue
 the value, containing the bytes (in its lowest part) to be put.len
 the amount of bytes to put (length
of the array to
create).
null
, with
length
the same as nonnegative len),
containing the bytes of unsignedValue.
java.lang.OutOfMemoryError
 if there is not enough memory.putToByteArray(byte[], int, long, int)
,
getFromByteArray(byte[], int, int)
,
toIntelArray(long, int)
,
writeBits(java.io.OutputStream, long, int)
public static final long getFromByteArray(byte[] bytes, int offset, int len) throws java.lang.NullPointerException, java.lang.ArrayIndexOutOfBoundsException
bytes
 the byte array (must be nonnull
) to get from.offset
 the first array index (must be in the range) to get at.len
 the amount of bytes to get.
java.lang.NullPointerException
 if bytes is null
.
java.lang.ArrayIndexOutOfBoundsException
 if len is positive and (offset is negative
or is greater than length
of bytes minus
len).putToByteArray(byte[], int, long, int)
,
toByteArray(long, int)
,
getFromIntelArray(byte[], int, int)
,
readBits(java.io.InputStream, int)
public static final void putToIntelArray(byte[] bytes, int offset, long unsignedValue, int len) throws java.lang.NullPointerException, java.lang.ArrayIndexOutOfBoundsException
JavaConsts LONG_LENGTH
then unsignedValue
is zeroextended.
bytes
 the byte array (must be nonnull
) to put to.offset
 the first array index (must be in the range) to put at.unsignedValue
 the value, containing the bytes (in its lowest part) to be put.len
 the amount of bytes to put.
java.lang.NullPointerException
 if bytes is null
.
java.lang.ArrayIndexOutOfBoundsException
 if len is positive and (offset is negative
or is greater than length
of bytes minus
len).toIntelArray(long, int)
,
getFromIntelArray(byte[], int, int)
,
putToByteArray(byte[], int, long, int)
public static final byte[] toIntelArray(long unsignedValue, int len)
JavaConsts LONG_LENGTH
then unsignedValue
is zeroextended.
unsignedValue
 the value, containing the bytes (in its lowest part) to be put.len
 the amount of bytes to put (length
of the array to
create).
null
, with
length
the same as nonnegative len),
containing the bytes of unsignedValue.
java.lang.OutOfMemoryError
 if there is not enough memory.putToIntelArray(byte[], int, long, int)
,
getFromIntelArray(byte[], int, int)
,
toByteArray(long, int)
public static final long getFromIntelArray(byte[] bytes, int offset, int len) throws java.lang.NullPointerException, java.lang.ArrayIndexOutOfBoundsException
bytes
 the byte array (must be nonnull
) to get from.offset
 the first array index (must be in the range) to get at.len
 the amount of bytes to get.
java.lang.NullPointerException
 if bytes is null
.
java.lang.ArrayIndexOutOfBoundsException
 if len is positive and (offset is negative
or is greater than length
of bytes minus
len).putToIntelArray(byte[], int, long, int)
,
toIntelArray(long, int)
,
getFromByteArray(byte[], int, int)
public static final void writeBits(java.io.OutputStream out, long unsignedValue, int count) throws java.lang.NullPointerException, java.io.IOException
JavaConsts LONG_SIZE
then the specified value
(containing the bits to write) is zeroextended; out
is a byteoriented stream, so given bits are padded with zeros
(on the most significant side); the bits are written starting
from the most significant one.
out
 the stream (must be nonnull
) to write to.unsignedValue
 the unsigned value, containing bits (in its lowest part) to be
written.count
 the amount of bits to be written.
java.lang.NullPointerException
 if out is null
.
java.io.IOException
 if an I/O error occurs.readBits(java.io.InputStream, int)
public static final long readBits(java.io.InputStream in, int count) throws java.lang.NullPointerException, java.io.IOException
EOFException
(subclass of IOException
) is thrown. Important
notes: if count is greater than
JavaConsts LONG_SIZE
then the result contains only
tail (the least significant) read bits portion fit the result;
in is a byteoriented stream, so padding bits are read
but set to zero (on the most significant side); the bits are read
starting from the most significant one.
in
 the stream (must be nonnull
) to read from.count
 the amount of bits to be read.
JavaConsts LONG_SIZE
).
java.lang.NullPointerException
 if in is null
.
java.io.IOException
 if the endofstream has been reached or an I/O error occurs.writeBits(java.io.OutputStream, long, int)
public static final java.lang.String toString(long value, boolean isUnsigned, boolean forceSign, int radix, boolean upperCase, int minLength)
value
 the signed/unsigned value to be converted.isUnsigned
 true
if value must be treated as an
unsigned value (but only if not forceSign), else
value is signed.forceSign
 true
if and only if the result must always have a
sign (positive or negative).radix
 the radix (any value) to be used as a base of the value string
format.upperCase
 true
if and only if (digit) characters in the result
are in the upper case.minLength
 the minimal length of the result (absolute value) and pad prefix
specifier (if negative then space padding else zero padding).
null
, with
length()
not less than
max(abs(minLength), 1)
) of value in the
specified radix.
java.lang.OutOfMemoryError
 if there is not enough memory.toBinaryString(long, int)
,
toOctalString(long, int)
,
toString(long, boolean)
,
toHexString(long, boolean, int)
,
parse(java.lang.String, int, int, boolean, int)
,
decode(java.lang.String, int, int)
public static final java.lang.String toString(long value, boolean isUnsigned)
value
 the signed/unsigned value to be converted.isUnsigned
 true
if value must be treated as an
unsigned value, else value is signed.
null
, with nonzero
length()
) of value in the decimal radix.
java.lang.OutOfMemoryError
 if there is not enough memory.toString(long, boolean, boolean, int, boolean, int)
,
toBinaryString(long, int)
,
toOctalString(long, int)
,
toHexString(long, boolean, int)
,
parse(java.lang.String, int, int, boolean, int)
,
decode(java.lang.String, int, int)
public static final java.lang.String toBinaryString(long unsignedValue, int minLength)
unsignedValue
 the unsigned value to be converted.minLength
 the minimal length of the result (absolute value) and pad prefix
specifier (if negative then space padding else zero padding).
null
, with
length()
not less than
max(abs(minLength), 1)
) of unsignedValue
in the binary radix.
java.lang.OutOfMemoryError
 if there is not enough memory.toString(long, boolean, boolean, int, boolean, int)
,
toOctalString(long, int)
,
toString(long, boolean)
,
toHexString(long, boolean, int)
,
parse(java.lang.String, int, int, boolean, int)
public static final java.lang.String toOctalString(long unsignedValue, int minLength)
unsignedValue
 the unsigned value to be converted.minLength
 the minimal length of the result (absolute value) and pad prefix
specifier (if negative then space padding else zero padding).
null
, with
length()
not less than
max(abs(minLength), 1)
) of unsignedValue
in the octal radix.
java.lang.OutOfMemoryError
 if there is not enough memory.toString(long, boolean, boolean, int, boolean, int)
,
toBinaryString(long, int)
,
toString(long, boolean)
,
toHexString(long, boolean, int)
,
parse(java.lang.String, int, int, boolean, int)
,
decode(java.lang.String, int, int)
public static final java.lang.String toHexString(long unsignedValue, boolean upperCase, int minLength)
unsignedValue
 the unsigned value to be converted.upperCase
 true
if and only if (digit) characters in the result
are in the upper case.minLength
 the minimal length of the result (absolute value) and pad prefix
specifier (if negative then space padding else zero padding).
null
, with
length()
not less than
max(abs(minLength), 1)
) of unsignedValue
in the hexadecimal radix.
java.lang.OutOfMemoryError
 if there is not enough memory.toString(long, boolean, boolean, int, boolean, int)
,
toBinaryString(long, int)
,
toOctalString(long, int)
,
toString(long, boolean)
,
parse(java.lang.String, int, int, boolean, int)
,
decode(java.lang.String, int, int)
public static final long parse(java.lang.String str, int beginIndex, int endIndex, boolean isUnsigned, int radix) throws java.lang.NullPointerException, java.lang.StringIndexOutOfBoundsException, ParserException
ParserException
is thrown if overflow occurs). If the specified radix is invalid
(less than two or too big) then it is corrected to the nearest
valid one. Important notes: use ('9'  '0' + 1)
to
parse a decimal number.
str
 the string (must be nonnull
), which region to
parse.beginIndex
 the string region beginning index (must be in the range),
inclusive.endIndex
 the string region ending index (must be in the range), exclusive.isUnsigned
 true
if and only if the result must be an unsigned
value.radix
 the radix (any value) to be used as a base of the value string
format.
java.lang.NullPointerException
 if str is null
.
java.lang.StringIndexOutOfBoundsException
 if beginIndex is negative, or if endIndex
is less than beginIndex or is greater than
length()
of str.
ParserException
 if str region cannot be parsed as a signed/unsigned
integer (error is set to 1
,
2
or 3
in the exception, meaning an
illegal character is found, number overflow occurs or unexpected
end of region is encountered at index, respectively).toString(long, boolean, boolean, int, boolean, int)
,
toBinaryString(long, int)
,
toOctalString(long, int)
,
toString(long, boolean)
,
toHexString(long, boolean, int)
,
decode(java.lang.String, int, int)
,
valueOf(java.lang.String)
public static final long decode(java.lang.String str, int beginIndex, int endIndex) throws java.lang.NullPointerException, java.lang.StringIndexOutOfBoundsException, ParserException
long
value formats are
accepted: decimal, hexadecimal (with '0x', '0X' or '#' prefix)
and octal (with '0' prefix). Leading spaces (before the prefix)
are ignored. Sign prefix is not permitted. Leading '0' characters
(after the prefix) are ignored too.
str
 the string (must be nonnull
), which region to
parse.beginIndex
 the string region beginning index (must be in the range),
inclusive.endIndex
 the string region ending index (must be in the range), exclusive.
java.lang.NullPointerException
 if str is null
.
java.lang.StringIndexOutOfBoundsException
 if beginIndex is negative, or if endIndex
is less than beginIndex or is greater than
length()
of str.
ParserException
 if str region cannot be parsed (decoded) as an
unsigned integer (error is set to 1
,
2
or 3
in the exception, meaning an
illegal character is found, number overflow occurs or unexpected
end of region is encountered at index, respectively).parse(java.lang.String, int, int, boolean, int)
,
toString(long, boolean, boolean, int, boolean, int)
,
toOctalString(long, int)
,
toString(long, boolean)
,
toHexString(long, boolean, int)
,
valueOf(java.lang.String)
public static UnsignedLong valueOf(java.lang.String str) throws java.lang.NullPointerException, ParserException
UnsignedLong
object
initialized to the unsigned decimal integer value of the
specified string.
str
 the string (must be nonnull
, representing a valid
unsigned decimal integer) to be parsed.
UnsignedLong
instance (not
null
) initialized to the value represented by
str.
java.lang.NullPointerException
 if str is null
.
ParserException
 if str cannot be parsed as an unsigned integer
(error is set to 1
, 2
or
3
in the exception, meaning an illegal character is
found, number overflow occurs or unexpected end of string is
encountered at index, respectively).
java.lang.OutOfMemoryError
 if there is not enough memory.UnsignedLong(long)
,
parse(java.lang.String, int, int, boolean, int)
,
decode(java.lang.String, int, int)
,
longValue()
,
toString()
public int intValue()
this
number as
int
.
The result is the same as of (int)longValue()
.
intValue
in class java.lang.Number
int
value represented by the object.UnsignedLong(long)
,
longValue()
,
floatValue()
,
doubleValue()
,
toString()
public long longValue()
this
number as
long
.
longValue
in class java.lang.Number
long
value represented by the object.UnsignedLong(long)
,
intValue()
,
floatValue()
,
doubleValue()
,
toString()
public float floatValue()
this
number as
float
.
The result is the same as of (float)doubleValue()
.
Important notes: this may involve rounding; the result is always
nonnegative.
floatValue
in class java.lang.Number
float
value represented by the object.UnsignedLong(long)
,
intValue()
,
longValue()
,
doubleValue()
,
toString()
public double doubleValue()
this
number as
double
.
Important notes: this may involve rounding; the result is always
nonnegative.
doubleValue
in class java.lang.Number
double
value represented by the object.UnsignedLong(long)
,
intValue()
,
longValue()
,
floatValue()
,
toString()
public java.lang.Object clone()
this
object.
The result is the same as of
new UnsignedLong(longValue())
.
clone
in interface ReallyCloneable
clone
in class java.lang.Object
null
and != this
) of
this
instance.
java.lang.OutOfMemoryError
 if there is not enough memory.UnsignedLong(long)
,
valueOf(java.lang.String)
,
longValue()
,
equals(java.lang.Object)
public int hashCode()
long
value are
mixed in a particular order to produce a single int
'hash' value. The result is the same as of
hashCode(longValue())
.
hashCode
in class java.lang.Object
this
object.hashCode(long)
,
longValue()
,
equals(java.lang.Object)
public boolean equals(java.lang.Object obj)
this
object is equal to the
specified one.
This method returns true
if and only if
obj is instance of this
class, and the
wrapped values of this
and of obj are
equal.
equals
in class java.lang.Object
obj
 the second compared object (may be null
).
true
if and only if this
value is the
same as obj value.compare(long, long)
,
longValue()
,
hashCode()
,
greaterThan(java.lang.Object)
public boolean greaterThan(java.lang.Object obj)
true
if and only if obj is
instance of this
class and the wrapped value of
this
object is greater (in the unsigned manner) than
the wrapped value of the specified object.
greaterThan
in interface Sortable
obj
 the second compared object (may be null
).
true
if obj is comparable with
this
and this
object is greater than
obj, else false
.greater(long, long)
,
compare(long, long)
,
longValue()
,
equals(java.lang.Object)
public java.lang.String toString()
this
object to its 'inline' string
representation.
The wrapped value is converted to its unsigned decimal
representation and returned as a string, exactly as by
toString(longValue(), true)
.
toString
in class java.lang.Object
null
, with nonzero
length()
) of this
object.
java.lang.OutOfMemoryError
 if there is not enough memory.UnsignedLong(long)
,
longValue()
,
toString(long, boolean)
,
toString(long, boolean, boolean, int, boolean, int)
,
valueOf(java.lang.String)


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 