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

Method frequency

output/java_guava/1.4.18/Iterators.java:398–400  ·  view source on GitHub ↗

Returns the number of elements in the specified iterator that equal the specified object. The iterator will be left exhausted: its hasNext() method will return false. @see Collections#frequency

(Iterator<?> iterator, @Nullable Object element)

Source from the content-addressed store, hash-verified

396
397
398 public static int frequency(Iterator<?> iterator, @Nullable Object element) {
399 return size(filter(iterator, equalTo(element)));
400 }
401
402 /**
403 * Returns an iterator that cycles indefinitely over the elements of {@code

Callers 1

frequencyMethod · 0.95

Calls 3

sizeMethod · 0.95
filterMethod · 0.95
equalToMethod · 0.45

Tested by

no test coverage detected