Module io.smallrye.common.search
Package io.smallrye.common.search
Class BinarySearch.IntRange.InCollection
java.lang.Object
io.smallrye.common.search.BinarySearch.IntRange.InCollection
- Enclosing class:
BinarySearch.IntRange
Search operations within a collection.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classSearch operations within a collection which operate on an extracted key. -
Method Summary
Modifier and TypeMethodDescriptionbyKey()Returns search operations which operate by an extracted key.<C> intfind(C collection, int from, int to, io.smallrye.common.function.ObjIntPredicate<C> test) Get the lowest index within the given range that satisfies the given test.<L extends List<?>>
intfind(L list, io.smallrye.common.function.ObjIntPredicate<L> test) Get the lowest index within the given random-access list that satisfies the given test.
-
Method Details
-
find
public <C> int find(C collection, int from, int to, io.smallrye.common.function.ObjIntPredicate<C> test) Get the lowest index within the given range that satisfies the given test.- Type Parameters:
C- 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)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
-
find
Get the lowest index within the given random-access list that satisfies the given test.- Type Parameters:
L- the list type- Parameters:
list- the list object (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
-