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

Method getNext

corpus/java/training/guava/collect/Iterators.java:819–822  ·  view source on GitHub ↗

Returns the next element in iterator or defaultValue if the iterator is empty. The Iterables analog to this method is Iterables#getFirst. @param defaultValue the default value to return if the iterator is empty @return the next element of iterator or the def

(Iterator<? extends T> iterator, @Nullable T defaultValue)

Source from the content-addressed store, hash-verified

817 * @since 7.0
818 */
819 @Nullable
820 public static <T> T getNext(Iterator<? extends T> iterator, @Nullable T defaultValue) {
821 return iterator.hasNext() ? iterator.next() : defaultValue;
822 }
823
824 /**
825 * Advances {@code iterator} to the end, returning the last element.

Callers 14

standardLowerMethod · 0.95
standardFloorMethod · 0.95
standardCeilingMethod · 0.95
standardHigherMethod · 0.95
firstEntryMethod · 0.95
lastEntryMethod · 0.95
getMethod · 0.95
getFirstMethod · 0.95
findMethod · 0.95
getMethod · 0.95
lowerMethod · 0.95
floorMethod · 0.95

Calls 2

nextMethod · 0.65
hasNextMethod · 0.45

Tested by

no test coverage detected