elementsEqual

Determines whether two iterables contain equal elements in the same order.
More specifically, this method returns true if iterable1
and iterable2 contain the same number of elements and every element
of iterable1 is equal to the corresponding element of
iterable2.

cycle

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 iterator's
hasNext() method returns true until iterable is
empty.

Warning: Typical uses of the resulting iterator may produce an
infinite loop. You should use an explicit break or be certain that
you will eventually remove all the elements.

To cycle over the iterable n times, use the following:
Iterables.concat(Collections.nCopies(n, iterable))

cycle

After remove is invoked on a generated iterator, the removed
element will no longer appear in either that iterator or any other iterator
created from the same source iterable. That is, this method behaves exactly
as Iterables.cycle(Lists.newArrayList(elements)). The iterator's
hasNext method returns true until all of the original
elements have been removed.

Warning: Typical uses of the resulting iterator may produce an
infinite loop. You should use an explicit break or be certain that
you will eventually remove all the elements.

To cycle over the elements n times, use the following:
Iterables.concat(Collections.nCopies(n, Arrays.asList(elements)))

concat

Combines two iterables into a single iterable. The returned iterable has an
iterator that traverses the elements in a, followed by the elements
in b. The source iterators are not polled until necessary.

The returned iterable's iterator supports remove() when the
corresponding input iterator supports it.

concat

Combines three iterables into a single iterable. The returned iterable has
an iterator that traverses the elements in a, followed by the
elements in b, followed by the elements in c. The source
iterators are not polled until necessary.

The returned iterable's iterator supports remove() when the
corresponding input iterator supports it.

concat

Combines four iterables into a single iterable. The returned iterable has
an iterator that traverses the elements in a, followed by the
elements in b, followed by the elements in c, followed by
the elements in d. The source iterators are not polled until
necessary.

The returned iterable's iterator supports remove() when the
corresponding input iterator supports it.

concat

Combines multiple iterables into a single iterable. The returned iterable
has an iterator that traverses the elements of each iterable in
inputs. The input iterators are not polled until necessary.

The returned iterable's iterator supports remove() when the
corresponding input iterator supports it. The methods of the returned
iterable may throw NullPointerException if any of the input
iterators are null.

partition

Divides an iterable into unmodifiable sublists of the given size (the final
iterable may be smaller). For example, partitioning an iterable containing
[a, b, c, d, e] with a partition size of 3 yields [[a, b, c], [d, e]] -- an outer iterable containing two inner lists of
three and two elements, all in the original order.

Iterators returned by the returned iterable do not support the Iterator.remove() method. The returned lists implement RandomAccess, whether or not the input list does.

paddedPartition

Divides an iterable into unmodifiable sublists of the given size, padding
the final iterable with null values if necessary. For example, partitioning
an iterable containing [a, b, c, d, e] with a partition size of 3
yields [[a, b, c], [d, e, null]] -- an outer iterable containing
two inner lists of three elements each, all in the original order.

Iterators returned by the returned iterable do not support the Iterator.remove() method.

Parameters:

iterable - the iterable to return a partitioned view of

size - the desired size of each partition

Returns:

an iterable of unmodifiable lists containing the elements of iterable divided into partitions (the final iterable may have
trailing null elements)

skip

Returns a view of iterable that skips its first
numberToSkip elements. If iterable contains fewer than
numberToSkip elements, the returned iterable skips all of its
elements.

Modifications to the underlying Iterable before a call to
iterator() are reflected in the returned iterator. That is, the
iterator skips the first numberToSkip elements that exist when the
Iterator is created, not when skip() is called.

The returned iterable's iterator supports remove() if the
iterator of the underlying iterable supports it. Note that it is
not possible to delete the last skipped element by immediately
calling remove() on that iterator, as the Iterator
contract states that a call to remove() before a call to
next() will throw an IllegalStateException.

Since:

3

limit

Creates an iterable with the first limitSize elements of the given
iterable. If the original iterable does not contain that many elements, the
returned iterator will have the same behavior as the original iterable. The
returned iterable's iterator supports remove() if the original
iterator does.