public final class Linqy
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
Linqy.FilteringIterator<T> |
private static class |
Linqy.MappingIterator<F,T> |
private static class |
Linqy.OnceOnlyIterator<E> |
Modifier | Constructor and Description |
---|---|
private |
Linqy() |
Modifier and Type | Method and Description |
---|---|
static <T> boolean |
all(java.lang.Iterable<T> sequence,
Predicate<? super T> predicate)
Determines whether a given predicate holds true for all
elements.
|
static <T> boolean |
any(java.lang.Iterable<T> sequence,
Predicate<? super T> predicate)
Determines whether a given predicate holds true for at least
one element.
|
static <E> java.util.List<E> |
asList(java.lang.Iterable<E> i)
Turns the iterable into a list.
|
static <E> java.lang.Iterable<E> |
cast(java.lang.Iterable i)
Turns an iterable into its type-safe cousin.
|
static int |
count(java.lang.Iterable seq)
Count the number of elements in a sequence.
|
static <T> java.lang.Iterable<T> |
filter(java.lang.Iterable<T> sequence,
Predicate<? super T> filter)
Exclude all elements from an iterable that don't match a given
predicate.
|
static <F,T> java.lang.Iterable<T> |
map(java.lang.Iterable<F> from,
Mapper<? super F,T> mapper)
Create a new iterable by applying a mapper function to each
element of a given sequence.
|
static <E> java.lang.Iterable<E> |
singleton(E single)
An iterable containing a single element.
|
public static <E> java.util.List<E> asList(java.lang.Iterable<E> i)
public static <E> java.lang.Iterable<E> cast(java.lang.Iterable i)
public static <E> java.lang.Iterable<E> singleton(E single)
public static <F,T> java.lang.Iterable<T> map(java.lang.Iterable<F> from, Mapper<? super F,T> mapper)
public static <T> java.lang.Iterable<T> filter(java.lang.Iterable<T> sequence, Predicate<? super T> filter)
public static int count(java.lang.Iterable seq)
public static <T> boolean any(java.lang.Iterable<T> sequence, Predicate<? super T> predicate)
Returns false for an empty sequence.
public static <T> boolean all(java.lang.Iterable<T> sequence, Predicate<? super T> predicate)
Returns true for an empty sequence.