Package org.polkadot.types.codec
Class AbstractInt
- java.lang.Object
-
- java.lang.Number
-
- java.math.BigInteger
-
- org.polkadot.types.codec.AbstractInt
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<java.math.BigInteger>,Codec
public abstract class AbstractInt extends java.math.BigInteger implements Codec
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractInt(boolean isNegative, java.lang.Object value, int bitLength, boolean isHexJson)
-
Method Summary
Modifier and Type Method Description intbitLength()Returns the number of bits in the valuebooleaneq(java.lang.Object other)Compares the value of the input to see if there is a matchintgetEncodedLength()The length of the value when encoded as a Uint8ArraybooleanisEmpty()Checks if the value is a zero value (align elsewhere)java.math.BigIntegertoBn()Returns the BN representation of the number.abstract java.lang.StringtoHex()Returns a hex string representation of the valuejava.lang.ObjecttoJson()Converts the Object to JSON, typically used for RPC transfersabstract byte[]toU8a(boolean isBare)-
Methods inherited from class java.math.BigInteger
abs, add, and, andNot, bitCount, byteValueExact, clearBit, compareTo, divide, divideAndRemainder, doubleValue, equals, flipBit, floatValue, gcd, getLowestSetBit, hashCode, intValue, intValueExact, isProbablePrime, longValue, longValueExact, max, min, mod, modInverse, modPow, multiply, negate, nextProbablePrime, not, or, pow, probablePrime, remainder, setBit, shiftLeft, shiftRight, shortValueExact, signum, sqrt, sqrtAndRemainder, subtract, testBit, toByteArray, toString, toString, valueOf, xor
-
-
-
-
Method Detail
-
getEncodedLength
public int getEncodedLength()
The length of the value when encoded as a Uint8Array- Specified by:
getEncodedLengthin interfaceCodec
-
isEmpty
public boolean isEmpty()
Checks if the value is a zero value (align elsewhere)
-
bitLength
public int bitLength()
Returns the number of bits in the value- Overrides:
bitLengthin classjava.math.BigInteger
-
eq
public boolean eq(java.lang.Object other)
Compares the value of the input to see if there is a match
-
toBn
public java.math.BigInteger toBn()
Returns the BN representation of the number. (Compatibility)
-
toHex
public abstract java.lang.String toHex()
Returns a hex string representation of the value
-
toJson
public java.lang.Object toJson()
Converts the Object to JSON, typically used for RPC transfers
-
-