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

Method frequency

corpus/java/training/guava/collect/Iterators.java:382–384  ·  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

380 * @see Collections#frequency
381 */
382 public static int frequency(Iterator<?> iterator, @Nullable Object element) {
383 return size(filter(iterator, equalTo(element)));
384 }
385
386 /**
387 * 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