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

Method cycle

output/java_guava/1.4.16/Iterables.java:423–436  ·  view source on GitHub ↗

Returns an iterable whose iterators cycle indefinitely over the elements of iterable. That iterator supports remove() if iterable.iterator() does. After remove() is called, subsequent cycles omit the removed element, which is no longer in iterable. The ite

(final Iterable<T> iterable)

Source from the content-addressed store, hash-verified

421
422
423 public static <T> Iterable<T> cycle(final Iterable<T> iterable) {
424 checkNotNull(iterable);
425 return new FluentIterable<T>() {
426 @Override
427 public Iterator<T> iterator() {
428 return Iterators.cycle(iterable);
429 }
430
431 @Override
432 public String toString() {
433 return iterable.toString() + " (cycled)";
434 }
435 };
436 }
437
438 /**
439 * Returns an iterable whose iterators cycle indefinitely over the provided

Callers 1

cycleMethod · 0.95

Calls 2

newArrayListMethod · 0.95
checkNotNullMethod · 0.45

Tested by

no test coverage detected