Module org.apache.arrow.algorithm
Package org.apache.arrow.algorithm.sort
Class DefaultVectorComparators.NullComparator
java.lang.Object
org.apache.arrow.algorithm.sort.VectorValueComparator<NullVector>
org.apache.arrow.algorithm.sort.DefaultVectorComparators.NullComparator
- Enclosing class:
- DefaultVectorComparators
public static class DefaultVectorComparators.NullComparator
extends VectorValueComparator<NullVector>
Default comparator for
NullVector.-
Field Summary
Fields inherited from class org.apache.arrow.algorithm.sort.VectorValueComparator
valueWidth, vector1, vector2 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompare(int index1, int index2) Compare two values, given their indices.intcompareNotNull(int index1, int index2) Compare two values, given their indices.Creates a comparator of the same type.Methods inherited from class org.apache.arrow.algorithm.sort.VectorValueComparator
attachVector, attachVectors, checkNullsOnCompare, getValueWidth
-
Constructor Details
-
NullComparator
public NullComparator()
-
-
Method Details
-
compare
public int compare(int index1, int index2) Description copied from class:VectorValueComparatorCompare two values, given their indices.- Overrides:
comparein classVectorValueComparator<NullVector>- Parameters:
index1- index of the first value to compare.index2- index of the second value to compare.- Returns:
- an integer greater than 0, if the first value is greater; an integer smaller than 0, if the first value is smaller; or 0, if both values are equal.
-
compareNotNull
public int compareNotNull(int index1, int index2) Description copied from class:VectorValueComparatorCompare two values, given their indices. This is a fast path for comparing non-null values, so the caller must make sure that values at both indices are not null.- Specified by:
compareNotNullin classVectorValueComparator<NullVector>- Parameters:
index1- index of the first value to compare.index2- index of the second value to compare.- Returns:
- an integer greater than 0, if the first value is greater; an integer smaller than 0, if the first value is smaller; or 0, if both values are equal.
-
createNew
Description copied from class:VectorValueComparatorCreates a comparator of the same type.- Specified by:
createNewin classVectorValueComparator<NullVector>- Returns:
- the newly created comparator.
-