org.qi4j.api.util
Class Iterables
java.lang.Object
org.qi4j.api.util.Iterables
public class Iterables
- extends Object
Utility methods for working with Iterables. See test for examples of how to use.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Iterables
public Iterables()
addAll
public static <T,C extends Collection<T>> C addAll(C collection,
Iterable<? extends T> iterable)
count
public static long count(Iterable<?> iterable)
filter
public static <X> Iterable<X> filter(Specification<? super X> specification,
Iterable<X> i)
first
public static <X> X first(Iterable<? extends X> i)
last
public static <X> X last(Iterable<? extends X> i)
reverse
public static <X> Iterable<X> reverse(Iterable<X> iterable)
matchesAny
public static <T> boolean matchesAny(Specification<? super T> specification,
Iterable<T> iterable)
flatten
public static <X> Iterable<X> flatten(Iterable<X>... multiIterator)
flatten
public static <X> Iterable<X> flatten(Iterable<Iterable<X>> multiIterator)
map
public static <FROM,TO> Iterable<TO> map(Function<? super FROM,TO> function,
Iterable<FROM> from)
iterable
public static <T> Iterable<T> iterable(Enumeration<T> enumeration)
iterable
public static <T> Iterable<T> iterable(T... items)