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

Method max

corpus/java/training/guava/collect/Ordering.java:588–598  ·  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

586 * @since 11.0
587 */
588 @CanIgnoreReturnValue // TODO(kak): Consider removing this
589 public <E extends T> E max(Iterator<E> iterator) {
590 // let this throw NoSuchElementException as necessary
591 E maxSoFar = iterator.next();
592
593 while (iterator.hasNext()) {
594 maxSoFar = max(maxSoFar, iterator.next());
595 }
596
597 return maxSoFar;
598 }
599
600 /**
601 * Returns the greatest of the specified values according to this ordering. If

Callers 14

leastOfMethod · 0.95
minusMethod · 0.45
longSizeMethod · 0.45
distanceMethod · 0.45
removeMethod · 0.45
closedTableSizeMethod · 0.45
intersectionMethod · 0.45
initialQueueSizeMethod · 0.45
addRightChildMethod · 0.45
addLeftChildMethod · 0.45
recomputeHeightMethod · 0.45
countMethod · 0.45

Calls 4

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

Tested by

no test coverage detected