Class Int128
java.lang.Object
io.trino.spi.type.Int128
- All Implemented Interfaces:
Comparable<Int128>
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic intcompare(long leftHigh, long leftLow, long rightHigh, long rightLow) intbooleanstatic Int128fromBigEndian(byte[] bytes) Decode an Int128 from the two's complement big-endian representation.longgetHigh()longgetLow()inthashCode()booleanbooleanisZero()byte[]voidtoBigEndianBytes(byte[] bytes, int offset) longtoLong()long[]longtoString()static Int128valueOf(long value) static Int128valueOf(long[] value) static Int128valueOf(long high, long low) static Int128static Int128valueOf(BigInteger value)
-
Field Details
-
SIZE
public static final int SIZE- See Also:
-
INSTANCE_SIZE
public static final int INSTANCE_SIZE -
MAX_VALUE
-
MIN_VALUE
-
ONE
-
ZERO
-
-
Method Details
-
fromBigEndian
Decode an Int128 from the two's complement big-endian representation.- Parameters:
bytes- the two's complement big-endian encoding of the number. It must contain at least 1 byte. It may contain more than 16 bytes if the leading bytes are not significant (either zeros or -1)- Throws:
ArithmeticException- if the bytes represent a number outside of the range [-2^127, 2^127 - 1]
-
valueOf
-
valueOf
-
valueOf
-
valueOf
-
valueOf
-
getHigh
public long getHigh() -
getLow
public long getLow() -
equals
-
hashCode
-
compareTo
- Specified by:
compareToin interfaceComparable<Int128>
-
toString
-
toBigInteger
-
toBigEndianBytes
public byte[] toBigEndianBytes() -
toBigEndianBytes
public void toBigEndianBytes(byte[] bytes, int offset) -
toLong
public long toLong() -
toLongExact
public long toLongExact() -
toLongArray
public long[] toLongArray() -
compare
public static int compare(long leftHigh, long leftLow, long rightHigh, long rightLow) -
isZero
public boolean isZero() -
isNegative
public boolean isNegative()
-