Class IntColumnBinarySearchKernel
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic RowSetbinarySearchMatch(@NotNull ElementSource<?> source, @NotNull RowSet selection, @NotNull SortColumn sortColumn, @NotNull Object[] searchValues, boolean usePrev) Performs a binary search on a given sortedElementSourceto find the row keys from a providedRowSetthat pass a range or match filter.static RowSetbinarySearchMax(@NotNull ElementSource<?> source, @NotNull RowSet selection, @NotNull SortColumn sortColumn, int max, boolean maxInc, boolean usePrev) Performs a binary search on a given sortedElementSourceto find the positions (row keys) of values less than a specified maximum.static RowSetbinarySearchMin(@NotNull ElementSource<?> source, @NotNull RowSet selection, @NotNull SortColumn sortColumn, int min, boolean minInc, boolean usePrev) Performs a binary search on a given sortedElementSourceto find the positions (row keys) of values greater than a specified minimum.static RowSetbinarySearchMinMax(@NotNull ElementSource<?> source, @NotNull RowSet selection, @NotNull SortColumn sortColumn, int min, int max, boolean minInc, boolean maxInc, boolean usePrev) Performs a binary search on a given sortedElementSourceto find the positions (row keys) of values within a specified range.static RowSetbinsearchRangeFilter(@NotNull ElementSource<?> source, @NotNull RowSet selection, @NotNull SortColumn sortColumn, @NotNull IntRangeFilter filter, boolean usePrev) Performs a binary search on a sortedElementSourceusing bounds from aIntRangeFilter, returning the row keys that satisfy the filter.
-
Constructor Details
-
IntColumnBinarySearchKernel
public IntColumnBinarySearchKernel()
-
-
Method Details
-
binsearchRangeFilter
public static RowSet binsearchRangeFilter(@NotNull @NotNull ElementSource<?> source, @NotNull @NotNull RowSet selection, @NotNull @NotNull SortColumn sortColumn, @NotNull @NotNull IntRangeFilter filter, boolean usePrev) Performs a binary search on a sortedElementSourceusing bounds from aIntRangeFilter, returning the row keys that satisfy the filter.- Parameters:
source- The element source to search.selection- TheRowSetdefining which rows are populated and the order in which they are searched.sortColumn- ASortColumnrepresenting the sorting order.filter- The range filter supplying lower/upper bounds and their inclusive flags.usePrev- If true, uses previous values instead of current values.- Returns:
- A
RowSetcontaining the row keys satisfying the filter.
-
binarySearchMatch
public static RowSet binarySearchMatch(@NotNull @NotNull ElementSource<?> source, @NotNull @NotNull RowSet selection, @NotNull @NotNull SortColumn sortColumn, @NotNull @NotNull Object[] searchValues, boolean usePrev) Performs a binary search on a given sortedElementSourceto find the row keys from a providedRowSetthat pass a range or match filter. The method returns theRowSetcontaining the matched row keys.The binary search is performed over the positions defined by
selection.RowSet.get(long)is used to map positions to row keys, ensuring O(log n) performance even when the row key space is sparse.- Parameters:
source- The element source in which the search will be performed.selection- TheRowSetdefining which rows are populated and the order in which they are searched.sortColumn- ASortColumnobject representing the sorting order of the column.searchValues- An array of keys to find within the source.usePrev- If true, the search will use the previous values (getPrevInt) instead of current values (getInt).- Returns:
- A
RowSetcontaining the row keys where the sorted keys were found.
-
binarySearchMinMax
public static RowSet binarySearchMinMax(@NotNull @NotNull ElementSource<?> source, @NotNull @NotNull RowSet selection, @NotNull @NotNull SortColumn sortColumn, int min, int max, boolean minInc, boolean maxInc, boolean usePrev) Performs a binary search on a given sortedElementSourceto find the positions (row keys) of values within a specified range.The binary search is performed over the positions defined by
selection.RowSet.get(long)is used to map positions to row keys, ensuring O(log n) performance even when the row key space is sparse.- Parameters:
source- The element source in which the search will be performed.selection- TheRowSetdefining which rows are populated and the order in which they are searched.sortColumn- ASortColumnobject representing the sorting order of the column.min- The minimum value of the range.max- The maximum value of the range.minInc-trueif the minimum value is inclusive,falseotherwise.maxInc-trueif the maximum value is inclusive,falseotherwise.usePrev- If true, the search will use the previous values (getPrevInt) instead of current values (getInt).- Returns:
- A
RowSetcontaining the row keys where the values were found.
-
binarySearchMin
public static RowSet binarySearchMin(@NotNull @NotNull ElementSource<?> source, @NotNull @NotNull RowSet selection, @NotNull @NotNull SortColumn sortColumn, int min, boolean minInc, boolean usePrev) Performs a binary search on a given sortedElementSourceto find the positions (row keys) of values greater than a specified minimum.The binary search is performed over the positions defined by
selection.RowSet.get(long)is used to map positions to row keys, ensuring O(log n) performance even when the row key space is sparse.- Parameters:
source- The element source in which the search will be performed.selection- TheRowSetdefining which rows are populated and the order in which they are searched.sortColumn- ASortColumnobject representing the sorting order of the column.min- The minimum value of the range.minInc-trueif the minimum value is inclusive,falseotherwise.usePrev- If true, the search will use the previous values (getPrevInt) instead of current values (getInt).- Returns:
- A
RowSetcontaining the row keys where the values were found.
-
binarySearchMax
public static RowSet binarySearchMax(@NotNull @NotNull ElementSource<?> source, @NotNull @NotNull RowSet selection, @NotNull @NotNull SortColumn sortColumn, int max, boolean maxInc, boolean usePrev) Performs a binary search on a given sortedElementSourceto find the positions (row keys) of values less than a specified maximum.The binary search is performed over the positions defined by
selection.RowSet.get(long)is used to map positions to row keys, ensuring O(log n) performance even when the row key space is sparse.- Parameters:
source- The element source in which the search will be performed.selection- TheRowSetdefining which rows are populated and the order in which they are searched.sortColumn- ASortColumnobject representing the sorting order of the column.max- The maximum value of the range.maxInc-trueif the maximum value is inclusive,falseotherwise.usePrev- If true, the search will use the previous values (getPrevInt) instead of current values (getInt).- Returns:
- A
RowSetcontaining the row keys where the values were found.
-