de.unkrig.commons.util.collections
Class IterableUtil

java.lang.Object
  extended by de.unkrig.commons.util.collections.IterableUtil

public final class IterableUtil
extends java.lang.Object

Various Iterable-related utility methods.


Method Summary
static
<T> java.lang.Iterable<T>
repeat(T subject, int n)
           
static
<E> java.lang.Iterable<E>
reverseList(java.util.List<E> list)
           
static
<T> java.lang.Iterable<T>
unmodifiableIterable(java.lang.Iterable<T> i)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

unmodifiableIterable

public static <T> java.lang.Iterable<T> unmodifiableIterable(java.lang.Iterable<T> i)
Returns:
An Iterable which can't be modified through the Iterator.remove() method

repeat

public static <T> java.lang.Iterable<T> repeat(T subject,
                                               int n)
Returns:
An Iterable producing the given subject n times

reverseList

public static <E> java.lang.Iterable<E> reverseList(java.util.List<E> list)
Returns:
An Iterable that traverses the elements of the given List in reverse order.