MCPcopy Index your code
hub / github.com/antlr/codebuff / getOnlyElement

Method getOnlyElement

output/java_guava/1.4.16/Iterables.java:310–312  ·  view source on GitHub ↗

Returns the single element contained in iterable. @throws NoSuchElementException if the iterable is empty @throws IllegalArgumentException if the iterable contains multiple elements

(Iterable<T> iterable)

Source from the content-addressed store, hash-verified

308
309
310 public static <T> T getOnlyElement(Iterable<T> iterable) {
311 return Iterators.getOnlyElement(iterable.iterator());
312 }
313
314 /**
315 * Returns the single element contained in {@code iterable}, or {@code

Callers 5

asImmutableMethod · 0.95
charsetMethod · 0.95
asImmutableMethod · 0.95
copyOfMethod · 0.95
buildMethod · 0.95

Calls 2

getOnlyElementMethod · 0.95
iteratorMethod · 0.65

Tested by

no test coverage detected