public final class VectorSearcher extends Object
Modifier and Type | Field and Description |
---|---|
static int |
SEARCH_FAIL_RESULT
Result returned when a search fails.
|
Modifier and Type | Method and Description |
---|---|
static <V extends ValueVector> |
binarySearch(V targetVector,
VectorValueComparator<V> comparator,
V keyVector,
int keyIndex)
Search for a particular element from the key vector in the target vector by binary search.
|
static <V extends ValueVector> |
linearSearch(V targetVector,
VectorValueComparator<V> comparator,
V keyVector,
int keyIndex)
Search for a particular element from the key vector in the target vector by traversing the vector in sequence.
|
public static final int SEARCH_FAIL_RESULT
public static <V extends ValueVector> int binarySearch(V targetVector, VectorValueComparator<V> comparator, V keyVector, int keyIndex)
V
- the vector type.targetVector
- the vector from which to perform the sort.comparator
- the criterion for the sort.keyVector
- the vector containing the element to search.keyIndex
- the index of the search key in the key vector.public static <V extends ValueVector> int linearSearch(V targetVector, VectorValueComparator<V> comparator, V keyVector, int keyIndex)
V
- the vector type.targetVector
- the vector from which to perform the search.comparator
- the criterion for element equality.keyVector
- the vector containing the element to search.keyIndex
- the index of the search key in the key vector.Copyright © 2023 The Apache Software Foundation. All rights reserved.