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

Method find

output/java_guava/1.4.17/Iterators.java:712–714  ·  view source on GitHub ↗

Returns the first element in iterator that satisfies the given predicate; use this method only when such an element is known to exist. If no such element is found, the iterator will be left exhausted: its hasNext() method will return false. If it is possible that no el

(Iterator<T> iterator, Predicate<? super T> predicate)

Source from the content-addressed store, hash-verified

710
711
712 public static <T> T find(Iterator<T> iterator, Predicate<? super T> predicate) {
713 return filter(iterator, predicate).next();
714 }
715
716 /**
717 * Returns the first element in {@code iterator} that satisfies the given

Callers 1

findMethod · 0.95

Calls 3

filterMethod · 0.95
getNextMethod · 0.95
nextMethod · 0.65

Tested by

no test coverage detected