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

Method isEmpty

output/java_guava/1.4.18/Iterables.java:1026–1031  ·  view source on GitHub ↗

Determines if the given iterable contains no elements. There is no precise Iterator equivalent to this method, since one can only ask an iterator whether it has any elements remaining (which one does using Iterator#hasNext). @return true if the iterable contains n

(Iterable<?> iterable)

Source from the content-addressed store, hash-verified

1024
1025
1026 public static boolean isEmpty(Iterable<?> iterable) {
1027 if (iterable instanceof Collection) {
1028 return ((Collection<?>) iterable).isEmpty();
1029 }
1030 return !iterable.iterator().hasNext();
1031 }
1032
1033 /**
1034 * Returns an iterable over the merged contents of all given

Callers 1

containsAllMethod · 0.95

Calls 3

isEmptyMethod · 0.65
iteratorMethod · 0.65
hasNextMethod · 0.45

Tested by

no test coverage detected