@Internal public final class BigIntComparator extends BasicTypeComparator<BigInteger>
ascendingComparison
Constructor and Description |
---|
BigIntComparator(boolean ascending) |
Modifier and Type | Method and Description |
---|---|
int |
compareSerialized(DataInputView firstSource,
DataInputView secondSource)
Compares two records in serialized form.
|
BigIntComparator |
duplicate()
Creates a copy of this class.
|
int |
getNormalizeKeyLen()
Gets the number of bytes that the normalized key would maximally take.
|
boolean |
isNormalizedKeyPrefixOnly(int keyBytes)
Checks, whether the given number of bytes for a normalized is only a prefix to determine the
order of elements of the data type for which this comparator provides the comparison methods.
|
void |
putNormalizedKey(BigInteger record,
MemorySegment target,
int offset,
int len)
Adds a normalized key containing the normalized number of bits and MSBs of the given record.
1 bit determines the sign (negative, zero/positive), 31 bit the bit length of the record.
|
boolean |
supportsNormalizedKey()
Checks whether the data type supports the creation of a normalized key for comparison.
|
boolean |
supportsSerializationWithKeyNormalization()
Check whether this comparator supports to serialize the record in a format that replaces its
keys by a normalized key.
|
compare, compareToReference, equalToReference, extractKeys, getFlatComparators, hash, invertNormalizedKey, readWithKeyDenormalization, setReference, writeWithKeyNormalization
compareAgainstReference, supportsCompareAgainstReference
public int compareSerialized(DataInputView firstSource, DataInputView secondSource) throws IOException
TypeComparator
Comparator.compare(Object, Object)
.
This method may de-serialize the records or compare them directly based on their binary representation.
compareSerialized
in class TypeComparator<BigInteger>
firstSource
- The input view containing the first record.secondSource
- The input view containing the second record.Comparator.compare(Object, Object)
.IOException
- Thrown, if any of the input views raised an exception when reading the
records.Comparator.compare(Object, Object)
public boolean supportsNormalizedKey()
TypeComparator
supportsNormalizedKey
in class TypeComparator<BigInteger>
public boolean supportsSerializationWithKeyNormalization()
TypeComparator
supportsSerializationWithKeyNormalization
in class BasicTypeComparator<BigInteger>
public int getNormalizeKeyLen()
TypeComparator
Integer
.MAX_VALUE is interpreted as infinite.getNormalizeKeyLen
in class TypeComparator<BigInteger>
public boolean isNormalizedKeyPrefixOnly(int keyBytes)
TypeComparator
isNormalizedKeyPrefixOnly
in class TypeComparator<BigInteger>
public void putNormalizedKey(BigInteger record, MemorySegment target, int offset, int len)
putNormalizedKey
in class TypeComparator<BigInteger>
record
- The record for which to create the normalized key.target
- The byte array into which to write the normalized key bytes.offset
- The offset in the byte array, where to start writing the normalized key bytes.len
- The number of bytes to be written exactly.NormalizableKey.copyNormalizedKey(MemorySegment, int, int)
public BigIntComparator duplicate()
TypeComparator
duplicate
in class TypeComparator<BigInteger>
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.