Module io.smallrye.common.search
Package io.smallrye.common.search
Class BinarySearch.ObjRange.InCollection
java.lang.Object
io.smallrye.common.search.BinarySearch.ObjRange.InCollection
- Enclosing class:
BinarySearch.ObjRange
Search operations within a collection.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classSearch operations within a collection which operate on an extracted key using a custom midpoint function. -
Method Summary
Modifier and TypeMethodDescriptionbyKey()Returns search operations which operate by an extracted key.<T,C> T find(C collection, T from, T to, BinaryOperator<T> midpoint, BiPredicate<C, T> test) Get the lowest index within the given range that satisfies the given test.
-
Method Details
-
find
Get the lowest index within the given range that satisfies the given test.- Type Parameters:
T- the index typeC- the collection type- Parameters:
collection- the collection object (must not benull)from- the low end of the range (inclusive)to- the high end of the range (exclusive)midpoint- the midpoint function (must not benull)test- the test (must not benull)- Returns:
- the lowest index within the range which satisfies the test, or
toif no values satisfy the test within the range
-
byKey
Returns search operations which operate by an extracted key.- Returns:
- search operations which operate by an extracted key
-