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

Method min

output/java_guava/1.4.18/Ordering.java:524–532  ·  view source on GitHub ↗

Returns the least of the specified values according to this ordering. If there are multiple least values, the first of those is returned. The iterator will be left exhausted: its hasNext() method will return false. @param iterator the iterator whose minimum element is to be determin

(Iterator<E> iterator)

Source from the content-addressed store, hash-verified

522 */
523
524 @CanIgnoreReturnValue // TODO(kak): Consider removing this
525 public <E extends T> E min(Iterator<E> iterator) {
526 // let this throw NoSuchElementException as necessary
527 E minSoFar = iterator.next();
528 while (iterator.hasNext()) {
529 minSoFar = min(minSoFar, iterator.next());
530 }
531 return minSoFar;
532 }
533
534 /**
535 * Returns the least of the specified values according to this ordering. If

Callers 1

leastOfMethod · 0.45

Calls 4

compareMethod · 0.95
nextMethod · 0.65
iteratorMethod · 0.65
hasNextMethod · 0.45

Tested by

no test coverage detected