@Internal public class FloatPrimitiveArrayComparator extends PrimitiveArrayComparator<float[],FloatComparator>
ascending, comparator, reference| Constructor and Description |
|---|
FloatPrimitiveArrayComparator(boolean ascending) |
| Modifier and Type | Method and Description |
|---|---|
int |
compare(float[] first,
float[] second)
Compares two records in serialized from.
|
TypeComparator<float[]> |
duplicate()
Creates a copy of this class.
|
int |
hash(float[] record)
Computes a hash value for the given record.
|
compareSerialized, compareToReference, equalToReference, extractKeys, getFlatComparators, getNormalizeKeyLen, invertNormalizedKey, isNormalizedKeyPrefixOnly, putNormalizedKey, readWithKeyDenormalization, setReference, supportsNormalizedKey, supportsSerializationWithKeyNormalization, writeWithKeyNormalizationcompareAgainstReference, supportsCompareAgainstReferencepublic FloatPrimitiveArrayComparator(boolean ascending)
public int hash(float[] record)
TypeComparatorThe 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<float[]>record - The record to be hashed.Object.hashCode()public int compare(float[] first,
float[] second)
TypeComparatorComparator.compare(Object, Object).
This method may de-serialize the records or compare them directly based on their binary representation.
compare in class TypeComparator<float[]>first - The first record.second - The second record.Comparator.compare(Object, Object).Comparator.compare(Object, Object)public TypeComparator<float[]> duplicate()
TypeComparatorduplicate in class TypeComparator<float[]>Copyright © 2014–2016 The Apache Software Foundation. All rights reserved.