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

Method from

corpus/java/training/guava/collect/FluentIterable.java:130–139  ·  view source on GitHub ↗

Returns a fluent iterable that wraps iterable, or iterable itself if it is already a FluentIterable. Stream equivalent: iterable.stream() if iterable is a Collection; StreamSupport.stream(iterable.spliterator(), false) otherw

(final Iterable<E> iterable)

Source from the content-addressed store, hash-verified

128 * {@link Collection}; {@code StreamSupport.stream(iterable.spliterator(), false)} otherwise.
129 */
130 public static <E> FluentIterable<E> from(final Iterable<E> iterable) {
131 return (iterable instanceof FluentIterable)
132 ? (FluentIterable<E>) iterable
133 : new FluentIterable<E>(iterable) {
134 @Override
135 public Iterator<E> iterator() {
136 return iterable.iterator();
137 }
138 };
139 }
140
141 /**
142 * Returns a fluent iterable containing {@code elements} in the specified order.

Callers 15

ofMethod · 0.95
cycleMethod · 0.95
appendMethod · 0.95
filterMethod · 0.95
transformMethod · 0.95
transformAndConcatMethod · 0.95
skipMethod · 0.95
limitMethod · 0.95
applyMethod · 0.95
getDeclaredAnnotationMethod · 0.95
delegateMethod · 0.95

Calls 2

asListMethod · 0.45
checkNotNullMethod · 0.45

Tested by

no test coverage detected