V
- type of the vector.public abstract class VectorValueComparator<V extends ValueVector> extends Object
Modifier and Type | Field and Description |
---|---|
protected int |
valueWidth
Width of the vector value.
|
protected V |
vector1
The first vector to compare.
|
protected V |
vector2
The second vector to compare.
|
Modifier | Constructor and Description |
---|---|
protected |
VectorValueComparator()
Constructor for variable-width vectors.
|
protected |
VectorValueComparator(int valueWidth)
Constructor for fixed-width vectors.
|
Modifier and Type | Method and Description |
---|---|
void |
attachVector(V vector)
Attach both vectors to compare to the same input vector.
|
void |
attachVectors(V vector1,
V vector2)
Attach vectors to compare.
|
boolean |
checkNullsOnCompare()
This value is true by default and re-computed when vectors are attached to the comparator.
|
int |
compare(int index1,
int index2)
Compare two values, given their indices.
|
abstract int |
compareNotNull(int index1,
int index2)
Compare two values, given their indices.
|
abstract VectorValueComparator<V> |
createNew()
Creates a comparator of the same type.
|
int |
getValueWidth() |
protected V extends ValueVector vector1
protected V extends ValueVector vector2
protected int valueWidth
protected VectorValueComparator()
protected VectorValueComparator(int valueWidth)
valueWidth
- the record width (in bytes).public boolean checkNullsOnCompare()
false
and calls to compare(i1, i2)
are short-circuited
to compareNotNull(i1, i2)
thereby speeding up comparisons resulting in faster sorts etc.public int getValueWidth()
public void attachVector(V vector)
vector
- the vector to attach.public void attachVectors(V vector1, V vector2)
vector1
- the first vector to compare.vector2
- the second vector to compare.public int compare(int index1, int index2)
index1
- index of the first value to compare.index2
- index of the second value to compare.public abstract int compareNotNull(int index1, int index2)
index1
- index of the first value to compare.index2
- index of the second value to compare.public abstract VectorValueComparator<V> createNew()
Copyright © 2023 The Apache Software Foundation. All rights reserved.