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

Method getFirst

output/java_guava/1.4.17/Iterables.java:812–815  ·  view source on GitHub ↗

Returns the first element in iterable or defaultValue if the iterable is empty. The Iterators analog to this method is Iterators#getNext. If no default value is desired (and the caller instead wants a NoSuchElementException to be thrown), it is recommende

(Iterable<? extends T> iterable, @Nullable T defaultValue)

Source from the content-addressed store, hash-verified

810 */
811
812 @Nullable
813 public static <T> T getFirst(Iterable<? extends T> iterable, @Nullable T defaultValue) {
814 return Iterators.getNext(iterable.iterator(), defaultValue);
815 }
816
817 /**
818 * Returns the last element of {@code iterable}. If {@code iterable} is a {@link List} with

Callers 6

ceilingMethod · 0.95
higherMethod · 0.95
ceilingMethod · 0.95
higherMethod · 0.95
standardFirstEntryMethod · 0.95
standardLastEntryMethod · 0.95

Calls 2

getNextMethod · 0.95
iteratorMethod · 0.65

Tested by

no test coverage detected