abstract class BaseUInt64Value<T : UInt64Value<T>> : UInt64Value<T> (source)
Base class for UInt64Value.
This class is abstract as it is not meant to be used directly, but it has no abstract methods. As mentioned in UInt64Value, this is used to create strongly-typed type aliases of UInt64. In other words, this allow to "tag" numbers with the unit of what they represent for the type-system, which can help clarity, but also forbid mixing numbers that are mean to be of different units (the strongly-typed part).
This class implements UInt64Value, but also adds a few operations that take a UInt64 directly, for instance #multiply(UInt64). The rational is that multiplying a given quantity of something by a "raw" number is always meaningful, and return a new quantity of the same thing.
- The concrete type of the value.
open fun add(value: T): Topen fun add(value: Long): Topen fun add(value: UInt64): T
Returns a value that is |
|
open fun addMod(value: T, modulus: UInt64): Topen fun addMod(value: Long, modulus: UInt64): Topen fun addMod(value: Long, modulus: Long): Topen fun addMod(value: UInt64, modulus: UInt64): T
Returns a value equivalent to |
|
open fun compareTo(other: T): Intopen fun compareTo(other: UInt64): Int
Compare two UInt64 values. |
|
open fun divide(value: T): Topen fun divide(value: Long): Topen fun divide(value: UInt64): T
Returns a value that is |
|
open fun equals(other: Any?): Boolean |
|
open fun hashCode(): Int |
|
open fun mod(modulus: UInt64): Topen fun mod(modulus: Long): T |
|
open fun multiply(value: T): Topen fun multiply(value: Long): Topen fun multiply(value: UInt64): T
Returns a value that is |
|
open fun multiplyMod(value: T, modulus: UInt64): Topen fun multiplyMod(value: Long, modulus: UInt64): Topen fun multiplyMod(value: Long, modulus: Long): Topen fun multiplyMod(value: UInt64, modulus: UInt64): T
Returns a value that is |
|
open fun pow(exponent: UInt64): Topen fun pow(exponent: Long): T |
|
open fun subtract(value: T): Topen fun subtract(value: Long): Topen fun subtract(value: UInt64): T
Returns a value that is |
|
open fun toBytes(): Bytes |
|
open fun toMinimalBytes(): Bytes |
|
open fun toString(): String |
|
open fun toUInt64(): UInt64 |
open fun addExact(value: T): Topen fun addExact(value: Long): T
Returns a value that is |
|
open fun bitLength(): Int |
|
open fun fitsInt(): Boolean |
|
open fun fitsLong(): Boolean |
|
open fun intValue(): Int |
|
open fun isZero(): Boolean |
|
open fun numberOfLeadingZeros(): Int |
|
open fun subtractExact(value: T): Topen fun subtractExact(value: Long): T
Returns a value that is |
|
open fun toBigInteger(): BigInteger |
|
open fun toHexString(): String
This value represented as an hexadecimal string. Note that this representation includes all the 8 underlying bytes, no matter what the integer actually represents (in other words, it can have many leading zeros). For a shorter representation that don't include leading zeros, use |
|
open fun toLong(): Long |
|
open fun toShortHexString(): String |