MCPcopy Create free account
hub / github.com/antlr/codebuff / binarySearch

Method binarySearch

output/java_guava/1.4.17/SortedLists.java:203–210  ·  view source on GitHub ↗

Searches the specified naturally ordered list for the specified object using the binary search algorithm. Equivalent to #binarySearch(List, Function, Object, Comparator, KeyPresentBehavior, KeyAbsentBehavior) using Ordering#natural.

(
    List<? extends E> list,
    E e,
    KeyPresentBehavior presentBehavior,
    KeyAbsentBehavior absentBehavior)

Source from the content-addressed store, hash-verified

201
202
203 public static <E extends Comparable> int binarySearch(
204 List<? extends E> list,
205 E e,
206 KeyPresentBehavior presentBehavior,
207 KeyAbsentBehavior absentBehavior) {
208 checkNotNull(e);
209 return binarySearch(list, e, Ordering.natural(), presentBehavior, absentBehavior);
210 }
211
212 /**
213 * Binary searches the list for the specified key, using the specified key function.

Callers 10

headIndexMethod · 0.95
tailIndexMethod · 0.95
indexOfMethod · 0.95
getMethod · 0.95
getEntryMethod · 0.95
subRangeMapMethod · 0.95
intersectsMethod · 0.95
enclosesMethod · 0.95
rangeContainingMethod · 0.95
intersectRangesMethod · 0.95

Calls 9

naturalMethod · 0.95
transformMethod · 0.95
newArrayListMethod · 0.95
sizeMethod · 0.65
getMethod · 0.65
checkNotNullMethod · 0.45
compareMethod · 0.45
resultIndexMethod · 0.45
subListMethod · 0.45

Tested by

no test coverage detected