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

Method all

corpus/java/training/guava/collect/Iterators.java:652–661  ·  view source on GitHub ↗

Returns true if every element returned by iterator satisfies the given predicate. If iterator is empty, true is returned.

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

Source from the content-addressed store, hash-verified

650 * is returned.
651 */
652 public static <T> boolean all(Iterator<T> iterator, Predicate<? super T> predicate) {
653 checkNotNull(predicate);
654 while (iterator.hasNext()) {
655 T element = iterator.next();
656 if (!predicate.apply(element)) {
657 return false;
658 }
659 }
660 return true;
661 }
662
663 /**
664 * Returns the first element in {@code iterator} that satisfies the given

Callers 1

allMethod · 0.95

Calls 4

nextMethod · 0.65
applyMethod · 0.65
checkNotNullMethod · 0.45
hasNextMethod · 0.45

Tested by

no test coverage detected