public final class UInt256 extends Object implements UInt256Value<UInt256>
UInt256Value - a 256-bit precision unsigned number of no
particular unit.| 限定符和类型 | 字段和说明 |
|---|---|
static UInt256 |
MAX_VALUE
The maximum value of a UInt256
|
static UInt256 |
MIN_VALUE
The minimum value of a UInt256
|
static UInt256 |
ONE
The value 1
|
static UInt256 |
ZERO
The value 0
|
| 限定符和类型 | 方法和说明 |
|---|---|
UInt256 |
add(long value)
Returns a value that is
(this + value). |
UInt256 |
add(UInt256 value)
Returns a value that is
(this + value). |
UInt256 |
addMod(long value,
long modulus)
Returns a value equivalent to
((this + value) mod modulus). |
UInt256 |
addMod(long value,
UInt256 modulus)
Returns a value equivalent to
((this + value) mod modulus). |
UInt256 |
addMod(UInt256 value,
UInt256 modulus)
Returns a value equivalent to
((this + value) mod modulus). |
UInt256 |
and(Bytes32 bytes)
Return a bit-wise AND of this value and the supplied bytes.
|
UInt256 |
and(UInt256 value)
Return a bit-wise AND of this value and the supplied value.
|
int |
bitLength()
Provides the number of bits following and including the highest-order ("leftmost")
one-bit in the binary representation of this value, or zero if all bits are zero.
|
int |
compareTo(UInt256 other) |
UInt256 |
divide(long value)
Returns a value that is
(this / value). |
UInt256 |
divide(UInt256 value)
Returns a value that is
(this / value). |
UInt256 |
divideCeil(long value)
Returns a value that is
ceiling(this / value). |
UInt256 |
divideCeil(UInt256 value)
Returns a value that is
ceiling(this / value). |
boolean |
equals(Object object) |
boolean |
fitsInt()
Returns true if the value can fit in an int.
|
boolean |
fitsLong()
Returns true if the value can fit in a long.
|
static UInt256 |
fromBytes(Bytes bytes)
Return a
UInt256 containing the value described by the specified bytes. |
static UInt256 |
fromHexString(String str)
Parse a hexadecimal string into a
UInt256. |
int |
hashCode() |
int |
intValue()
Provides this value as an int.
|
boolean |
isZero()
Returns true is the value is 0.
|
UInt256 |
mod(long modulus)
Returns a value that is
(this mod modulus). |
UInt256 |
mod(UInt256 modulus)
Returns a value that is
(this mod modulus). |
UInt256 |
mod0(long modulus)
Returns a value that is
(this mod modulus), or 0 if modulus is 0. |
UInt256 |
mod0(UInt256 modulus)
Returns a value that is
(this mod modulus), or 0 if modulus is 0. |
UInt256 |
multiply(long value)
Returns a value that is
(this * value). |
UInt256 |
multiply(UInt256 value)
Returns a value that is
(this * value). |
UInt256 |
multiplyMod(long value,
long modulus)
Returns a value that is
((this * value) mod modulus). |
UInt256 |
multiplyMod(long value,
UInt256 modulus)
Returns a value that is
((this * value) mod modulus). |
UInt256 |
multiplyMod(UInt256 value,
UInt256 modulus)
Returns a value that is
((this * value) mod modulus). |
UInt256 |
not()
Return a bit-wise NOT of this value.
|
int |
numberOfLeadingZeros()
Provides the number of zero bits preceding the highest-order one-bit.
|
UInt256 |
or(Bytes32 bytes)
Return a bit-wise OR of this value and the supplied bytes.
|
UInt256 |
or(UInt256 value)
Return a bit-wise OR of this value and the supplied value.
|
UInt256 |
pow(long exponent)
Returns a value that is
(this<sup>exponent</sup> mod 2<sup>256</sup>)
This calculates an exponentiation over the modulus of 2^256. |
UInt256 |
pow(UInt256 exponent)
Returns a value that is
(this<sup>exponent</sup> mod 2<sup>256</sup>)
This calculates an exponentiation over the modulus of 2^256. |
UInt256 |
shiftLeft(int distance)
Shift all bits in this value to the left.
|
UInt256 |
shiftRight(int distance)
Shift all bits in this value to the right.
|
UInt256 |
subtract(long value)
Returns a value that is
(this - value). |
UInt256 |
subtract(UInt256 value)
Returns a value that is
(this - value). |
BigInteger |
toBigInteger()
Provides the value as a BigInteger.
|
Bytes32 |
toBytes()
Provides the value as bytes.
|
long |
toLong()
Provides the value as a long.
|
Bytes |
toMinimalBytes()
Provides the value as bytes without any leading zero bytes.
|
String |
toString() |
UInt256 |
toUInt256()
Convert this value to a
UInt256. |
static UInt256 |
valueOf(BigInteger value)
Return a
UInt256 containing the specified value. |
static UInt256 |
valueOf(long value)
Return a
UInt256 containing the specified value. |
UInt256 |
xor(Bytes32 bytes)
Return a bit-wise XOR of this value and the supplied bytes.
|
UInt256 |
xor(UInt256 value)
Return a bit-wise XOR of this value and the supplied value.
|
addExact, addExact, plus, plus, subtractExact, subtractExact, toHexString, toShortHexStringpublic static final UInt256 MIN_VALUE
public static final UInt256 MAX_VALUE
public static final UInt256 ZERO
public static final UInt256 ONE
public static UInt256 valueOf(long value)
UInt256 containing the specified value.value - The value to create a UInt256 for.UInt256 containing the specified value.IllegalArgumentException - If the value is negative.public static UInt256 valueOf(BigInteger value)
UInt256 containing the specified value.value - the value to create a UInt256 forUInt256 containing the specified valueIllegalArgumentException - if the value is negative or too large to be
represented as a UInt256public static UInt256 fromBytes(Bytes bytes)
UInt256 containing the value described by the specified bytes.bytes - The bytes containing a UInt256.UInt256 containing the specified value.IllegalArgumentException - if bytes.size() > 32.public static UInt256 fromHexString(String str)
UInt256.str - The hexadecimal string to parse, which may or may not start with "0x".
That representation may contain less than 32 bytes, in which case the result is
left padded with zeros.str.IllegalArgumentException - if str does not correspond to a valid
hexadecimal representation or contains more than 32 bytes.public boolean isZero()
UInt256ValueisZero 在接口中 UInt256Value<UInt256>public UInt256 add(UInt256 value)
UInt256Value(this + value).add 在接口中 UInt256Value<UInt256>value - The amount to be added to this value.this + valuepublic UInt256 add(long value)
UInt256Value(this + value).add 在接口中 UInt256Value<UInt256>value - The amount to be added to this value.this + valuepublic UInt256 addMod(UInt256 value, UInt256 modulus)
UInt256Value((this + value) mod modulus).addMod 在接口中 UInt256Value<UInt256>value - The amount to be added to this value.modulus - The modulus.(this + value) mod moduluspublic UInt256 addMod(long value, UInt256 modulus)
UInt256Value((this + value) mod modulus).addMod 在接口中 UInt256Value<UInt256>value - The amount to be added to this value.modulus - The modulus.(this + value) mod moduluspublic UInt256 addMod(long value, long modulus)
UInt256Value((this + value) mod modulus).addMod 在接口中 UInt256Value<UInt256>value - The amount to be added to this value.modulus - The modulus.(this + value) mod moduluspublic UInt256 subtract(UInt256 value)
UInt256Value(this - value).subtract 在接口中 UInt256Value<UInt256>value - The amount to be subtracted from this value.this - valuepublic UInt256 subtract(long value)
UInt256Value(this - value).subtract 在接口中 UInt256Value<UInt256>value - The amount to be subtracted from this value.this - valuepublic UInt256 multiply(UInt256 value)
UInt256Value(this * value).multiply 在接口中 UInt256Value<UInt256>value - The amount to multiply this value by.this * valuepublic UInt256 multiply(long value)
UInt256Value(this * value).multiply 在接口中 UInt256Value<UInt256>value - The amount to multiply this value by.this * valuepublic UInt256 multiplyMod(UInt256 value, UInt256 modulus)
UInt256Value((this * value) mod modulus).multiplyMod 在接口中 UInt256Value<UInt256>value - The amount to multiply this value by.modulus - The modulus.(this * value) mod moduluspublic UInt256 multiplyMod(long value, UInt256 modulus)
UInt256Value((this * value) mod modulus).multiplyMod 在接口中 UInt256Value<UInt256>value - The amount to multiply this value by.modulus - The modulus.(this * value) mod moduluspublic UInt256 multiplyMod(long value, long modulus)
UInt256Value((this * value) mod modulus).multiplyMod 在接口中 UInt256Value<UInt256>value - The amount to multiply this value by.modulus - The modulus.(this * value) mod moduluspublic UInt256 divide(UInt256 value)
UInt256Value(this / value).divide 在接口中 UInt256Value<UInt256>value - The amount to divide this value by.this / valuepublic UInt256 divide(long value)
UInt256Value(this / value).divide 在接口中 UInt256Value<UInt256>value - The amount to divide this value by.this / valuepublic UInt256 divideCeil(UInt256 value)
UInt256Valueceiling(this / value).divideCeil 在接口中 UInt256Value<UInt256>value - The amount to divide this value by.this / value + ( this % value == 0 ? 0 : 1)public UInt256 divideCeil(long value)
UInt256Valueceiling(this / value).divideCeil 在接口中 UInt256Value<UInt256>value - The amount to divide this value by.this / value + ( this % value == 0 ? 0 : 1)public UInt256 pow(UInt256 exponent)
UInt256Value(this<sup>exponent</sup> mod 2<sup>256</sup>)
This calculates an exponentiation over the modulus of 2^256.
Note that exponent is an UInt256 rather than of the type T.
pow 在接口中 UInt256Value<UInt256>exponent - The exponent to which this value is to be raised.this<sup>exponent</sup> mod 2<sup>256</sup>public UInt256 pow(long exponent)
UInt256Value(this<sup>exponent</sup> mod 2<sup>256</sup>)
This calculates an exponentiation over the modulus of 2^256.
pow 在接口中 UInt256Value<UInt256>exponent - The exponent to which this value is to be raised.this<sup>exponent</sup> mod 2<sup>256</sup>public UInt256 mod(UInt256 modulus)
UInt256Value(this mod modulus).mod 在接口中 UInt256Value<UInt256>modulus - The modulus.this mod modulus.public UInt256 mod(long modulus)
UInt256Value(this mod modulus).mod 在接口中 UInt256Value<UInt256>modulus - The modulus.this mod modulus.public UInt256 mod0(UInt256 modulus)
UInt256Value(this mod modulus), or 0 if modulus is 0.mod0 在接口中 UInt256Value<UInt256>modulus - The modulus.this mod modulus.public UInt256 mod0(long modulus)
UInt256Value(this mod modulus), or 0 if modulus is 0.mod0 在接口中 UInt256Value<UInt256>modulus - The modulus.this mod modulus.public UInt256 and(UInt256 value)
value - the value to perform the operation withpublic UInt256 and(Bytes32 bytes)
bytes - the bytes to perform the operation withpublic UInt256 or(UInt256 value)
value - the value to perform the operation withpublic UInt256 or(Bytes32 bytes)
bytes - the bytes to perform the operation withpublic UInt256 xor(UInt256 value)
value - the value to perform the operation withpublic UInt256 xor(Bytes32 bytes)
bytes - the bytes to perform the operation withpublic UInt256 not()
public UInt256 shiftRight(int distance)
distance - The number of bits to shift by.public UInt256 shiftLeft(int distance)
distance - The number of bits to shift by.public int compareTo(UInt256 other)
compareTo 在接口中 Comparable<UInt256>public boolean fitsInt()
UInt256ValuefitsInt 在接口中 UInt256Value<UInt256>int (i.e. is less or equal to
Integer.MAX_VALUE).public int intValue()
UInt256ValueintValue 在接口中 UInt256Value<UInt256>int assuming it is small enough to fit an
int.public boolean fitsLong()
UInt256ValuefitsLong 在接口中 UInt256Value<UInt256>long (i.e. is less or equal to
Long.MAX_VALUE).public long toLong()
UInt256ValuetoLong 在接口中 UInt256Value<UInt256>long assuming it is small enough to fit a
long.public BigInteger toBigInteger()
UInt256ValuetoBigInteger 在接口中 UInt256Value<UInt256>BigInteger.public UInt256 toUInt256()
UInt256ValueUInt256.toUInt256 在接口中 UInt256Value<UInt256>UInt256.public Bytes32 toBytes()
UInt256ValuetoBytes 在接口中 UInt256Value<UInt256>public Bytes toMinimalBytes()
UInt256ValuetoMinimalBytes 在接口中 UInt256Value<UInt256>public int numberOfLeadingZeros()
UInt256ValuenumberOfLeadingZeros 在接口中 UInt256Value<UInt256>public int bitLength()
UInt256ValuebitLength 在接口中 UInt256Value<UInt256>Copyright © 2021. All rights reserved.