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

Method size

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

Returns the number of elements remaining in iterator. The iterator will be left exhausted: its hasNext() method will return false.

(Iterator<?> iterator)

Source from the content-addressed store, hash-verified

195 * {@code false}.
196 */
197 public static int size(Iterator<?> iterator) {
198 long count = 0L;
199 while (iterator.hasNext()) {
200 iterator.next();
201 count++;
202 }
203 return Ints.saturatedCast(count);
204 }
205
206 /**
207 * Returns {@code true} if {@code iterator} contains {@code element}.

Callers 11

sizeMethod · 0.95
sizeMethod · 0.95
sizeMethod · 0.95
sizeMethod · 0.95
sizeMethod · 0.95
sizeMethod · 0.95
frequencyMethod · 0.95
sizeMethod · 0.95
distinctElementsMethod · 0.95
sizeMethod · 0.95
sizeMethod · 0.95

Calls 3

saturatedCastMethod · 0.95
nextMethod · 0.65
hasNextMethod · 0.45

Tested by

no test coverage detected