public final class UnsignedLong extends Number implements Comparable<Number>, BitField
| Modifier and Type | Field and Description |
|---|---|
static UnsignedLong[] |
EMPTY_ARRAY |
static NodeId |
ID
Deprecated.
use
Identifiers.UInt64 instead. |
static UnsignedLong |
MAX_VALUE |
static UnsignedLong |
MIN_VALUE |
static UnsignedLong |
ONE |
static int |
SIZE |
static UnsignedLong |
ZERO |
| Constructor and Description |
|---|
UnsignedLong(BigInteger value)
Deprecated.
use
valueOf(BigInteger) instead. |
UnsignedLong(int value)
Deprecated.
use
valueOf(long) instead. |
UnsignedLong(long value)
Deprecated.
use
valueOf(long) instead. |
UnsignedLong(String value)
Deprecated.
use
valueOf(String) instead. |
| Modifier and Type | Method and Description |
|---|---|
UnsignedLong |
add(long increment)
Add a value.
|
UnsignedLong |
add(UnsignedLong increment)
Add a value.
|
static UnsignedLong[] |
arrayOf()
Returns an empty UnsignedLong array.
|
static UnsignedLong[] |
arrayOf(BigInteger... elements)
Returns an UnsignedLong array from the given elements.
|
static UnsignedLong[] |
arrayOf(long... elements)
Returns an UnsignedLong array with the given elements.
|
static UnsignedLong[] |
arrayOf(String... elements)
Returns an UnsignedLong array with the given elements.
|
BigInteger |
bigIntegerValue()
bigIntegerValue.
|
int |
compareTo(Number other)
compareTo.
|
UnsignedLong |
dec()
Decrease the value by one.
|
UnsignedLong |
decOrWrap()
|
UnsignedLong |
decOrWrapTo(UnsignedLong target)
If equals
MIN_VALUE, returns the given target, otherwise return value - 1. |
double |
doubleValue() |
boolean |
equals(Object obj) |
float |
floatValue() |
static UnsignedLong |
getFromBits(long bits)
Create unsigned long from 64 bits.
|
int |
hashCode() |
UnsignedLong |
inc()
Increase the value by one.
|
UnsignedLong |
incOrWrap()
|
UnsignedLong |
incOrWrapTo(UnsignedLong target)
If equals
MAX_VALUE, returns the given target, otherwise return value + 1. |
int |
intValue() |
boolean |
isBitSet(int position)
Is bit set in position.
|
long |
longValue() |
static UnsignedLong |
parseUnsignedLong(String string)
Parse an UnsignedLong value from a string.
|
static UnsignedLong |
parseUnsignedLong(String string,
int radix)
Parses the string argument as an unsigned long similar to
Integer.parseInt(String, int). |
UnsignedLong |
subtract(long decrement)
Subtract a value from this value.
|
UnsignedLong |
subtract(UnsignedLong decrement)
Subtract a value from this value.
|
String |
toHex()
Convert the value to a hexadecimal string.
|
long |
toLongBits()
toLongBits.
|
String |
toString() |
static UnsignedLong |
valueOf(BigInteger value)
Get cached or new instance.
|
static UnsignedLong |
valueOf(long value)
Get cached or create new instance.
|
static UnsignedLong |
valueOf(String string)
Parses
UnsignedLong from String. |
static UnsignedLong |
valueOf(String string,
int radix)
Parses
UnsignedLong from String. |
byteValue, shortValue@Deprecated public static final NodeId ID
Identifiers.UInt64 instead.public static final int SIZE
public static final UnsignedLong MAX_VALUE
public static final UnsignedLong MIN_VALUE
public static final UnsignedLong ZERO
public static final UnsignedLong ONE
public static final UnsignedLong[] EMPTY_ARRAY
@Deprecated public UnsignedLong(BigInteger value) throws IllegalArgumentException
valueOf(BigInteger) instead.Constructor for UnsignedLong.
value - a BigInteger object.IllegalArgumentException - if any.@Deprecated public UnsignedLong(int value)
valueOf(long) instead.Constructor for UnsignedLong.
value - a int.@Deprecated public UnsignedLong(long value)
valueOf(long) instead.value - a long.@Deprecated public UnsignedLong(String value)
valueOf(String) instead.Constructor for UnsignedLong.
value - a String object.public static UnsignedLong[] arrayOf()
public static UnsignedLong[] arrayOf(BigInteger... elements)
UnsignedShort#valueOf(BigInteger). If given null array for elements returns null.public static UnsignedLong[] arrayOf(long... elements)
valueOf(long). If given null array for elements returns null.public static UnsignedLong[] arrayOf(String... elements)
valueOf(String). If given null array for elements returns null.public static UnsignedLong getFromBits(long bits)
bits - a long.public static UnsignedLong parseUnsignedLong(String string)
string - the string to parse, assumed to contain a positive Long valuepublic static UnsignedLong parseUnsignedLong(String string, int radix) throws NumberFormatException, IllegalArgumentException
Integer.parseInt(String, int).string - the string to parse, assumed to contain a positive Long valueradix - the radix to be used while parsing s.NumberFormatException - if the string cannot be parsed into an integer valueIllegalArgumentException - if the parsed value does not fit in the range of
UnsignedIntegerpublic static UnsignedLong valueOf(BigInteger value)
public static UnsignedLong valueOf(long value)
value - a long.public static UnsignedLong valueOf(String string)
UnsignedLong from String. Behaves same as parseUnsignedLong(String).public static UnsignedLong valueOf(String string, int radix)
UnsignedLong from String. Behaves same as
parseUnsignedLong(String, int).public UnsignedLong add(long increment)
increment - the value to add to the current valuepublic UnsignedLong add(UnsignedLong increment)
increment - the value to add to the current valuepublic BigInteger bigIntegerValue()
bigIntegerValue.
BigInteger object.public int compareTo(Number other)
compareTo.
compareTo in interface Comparable<Number>other - a Number object.public UnsignedLong dec()
IllegalArgumentException - if the value was 0 before the callpublic UnsignedLong decOrWrap()
public UnsignedLong decOrWrapTo(UnsignedLong target)
MIN_VALUE, returns the given target, otherwise return value - 1.public double doubleValue()
doubleValue in class Numberpublic float floatValue()
floatValue in class Numberpublic UnsignedLong inc()
public UnsignedLong incOrWrap()
public UnsignedLong incOrWrapTo(UnsignedLong target)
MAX_VALUE, returns the given target, otherwise return value + 1.public boolean isBitSet(int position)
BitFieldpublic UnsignedLong subtract(long decrement)
decrement - the value to subtract from the current valueIllegalArgumentException - if the decrement is bigger than the current valuepublic UnsignedLong subtract(UnsignedLong decrement)
decrement - the value to subtract from the current valueIllegalArgumentException - if the decrement is bigger than the current valuepublic String toHex()
Uses CryptoUtil.toHex(long) to do the conversion.
public long toLongBits()
toLongBits.
Copyright © 2026. All rights reserved.