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

Method size

output/java_guava/1.4.18/Iterators.java:202–209  ·  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

200
201
202 public static int size(Iterator<?> iterator) {
203 long count = 0L;
204 while (iterator.hasNext()) {
205 iterator.next();
206 count++;
207 }
208 return Ints.saturatedCast(count);
209 }
210
211 /**
212 * 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