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

Method max

output/java_guava/1.4.16/Ordering.java:603–611  ·  view source on GitHub ↗

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

(Iterator<E> iterator)

Source from the content-addressed store, hash-verified

601 */
602
603 @CanIgnoreReturnValue // TODO(kak): Consider removing this
604 public <E extends T> E max(Iterator<E> iterator) {
605 // let this throw NoSuchElementException as necessary
606 E maxSoFar = iterator.next();
607 while (iterator.hasNext()) {
608 maxSoFar = max(maxSoFar, iterator.next());
609 }
610 return maxSoFar;
611 }
612
613 /**
614 * Returns the greatest of the specified values according to this ordering. If

Callers 1

leastOfMethod · 0.95

Calls 4

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

Tested by

no test coverage detected