@Internal public class IntPrimitiveArrayComparator extends PrimitiveArrayComparator<int[],IntComparator>
ascending, comparator, reference
Constructor and Description |
---|
IntPrimitiveArrayComparator(boolean ascending) |
Modifier and Type | Method and Description |
---|---|
int |
compare(int[] first,
int[] second)
Compares two records in object form.
|
TypeComparator<int[]> |
duplicate()
Creates a copy of this class.
|
int |
hash(int[] record)
Computes a hash value for the given record.
|
compareSerialized, compareToReference, equalToReference, extractKeys, getFlatComparators, getNormalizeKeyLen, invertNormalizedKey, isNormalizedKeyPrefixOnly, putNormalizedKey, readWithKeyDenormalization, setReference, supportsNormalizedKey, supportsSerializationWithKeyNormalization, writeWithKeyNormalization
compareAgainstReference, supportsCompareAgainstReference
public IntPrimitiveArrayComparator(boolean ascending)
public int hash(int[] record)
TypeComparator
The hash code is typically not used as it is in hash tables and for partitioning, but it is further scrambled to make sure that a projection of the hash values to a lower cardinality space is as results in a rather uniform value distribution. However, any collisions produced by this method cannot be undone. While it is NOT important to create hash codes that cover the full spectrum of bits in the integer, it IS important to avoid collisions when combining two value as much as possible.
hash
in class TypeComparator<int[]>
record
- The record to be hashed.Object.hashCode()
public int compare(int[] first, int[] second)
TypeComparator
Comparator.compare(Object, Object)
.compare
in class TypeComparator<int[]>
first
- The first record.second
- The second record.Comparator.compare(Object, Object)
.Comparator.compare(Object, Object)
public TypeComparator<int[]> duplicate()
TypeComparator
duplicate
in class TypeComparator<int[]>
Copyright © 2014–2024 The Apache Software Foundation. All rights reserved.