org.hibernate.shards.util
Class Iterables
java.lang.Object
org.hibernate.shards.util.Iterables
public class Iterables
- extends Object
Helper methods related to Iterable
s.
- Author:
- maxr@google.com (Max Ross)
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
concat
public static <T> Iterable<T> concat(Iterable<? extends T>... iterables)
- Returns:
- an Iterable that allows you to iterate over the contents of
all the iterables passed in.
concat
public static <T> Iterable<T> concat(Iterable<? extends Iterable<? extends T>> iterable)
- Returns:
- an Iterable that allows you to iterate over the contents of
all the iterables passed in.
rotate
public static <T> Iterable<T> rotate(List<T> list,
int distance)
- Provides a rotated view of a list. Differs from
Collections.rotate(java.util.List>, int)
only in that it leaves the underlying list unchanged. Note that this is a
"live" view of the list that will change as the list changes. However, the
behavior of an Iterator
constructed from a rotated view of the list
is undefined if the list is changed after the Iterator is constructed.
- Parameters:
list
- the list to return a rotated view of.distance
- the distance to rotate the list. There are no constraints
on this value; it may be zero, negative, or greater than
list.size()
.
- Returns:
- a rotated view of the given list