@Internal public class ShortPrimitiveArrayComparator extends PrimitiveArrayComparator<short[],ShortComparator>
ascending, comparator, reference
Constructor and Description |
---|
ShortPrimitiveArrayComparator(boolean ascending) |
Modifier and Type | Method and Description |
---|---|
int |
compare(short[] first,
short[] second)
Compares two records in object form.
|
TypeComparator<short[]> |
duplicate()
Creates a copy of this class.
|
int |
hash(short[] 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 ShortPrimitiveArrayComparator(boolean ascending)
public int hash(short[] 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<short[]>
record
- The record to be hashed.Object.hashCode()
public int compare(short[] first, short[] second)
TypeComparator
Comparator.compare(Object, Object)
.compare
in class TypeComparator<short[]>
first
- The first record.second
- The second record.Comparator.compare(Object, Object)
.Comparator.compare(Object, Object)
public TypeComparator<short[]> duplicate()
TypeComparator
duplicate
in class TypeComparator<short[]>
Copyright © 2014–2021 The Apache Software Foundation. All rights reserved.