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

Method getNext

output/java_guava/1.4.17/Iterators.java:865–868  ·  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

863 */
864
865 @Nullable
866 public static <T> T getNext(Iterator<? extends T> iterator, @Nullable T defaultValue) {
867 return iterator.hasNext() ? iterator.next() : defaultValue;
868 }
869
870 /**
871 * 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