public final class Linq
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_LIST_SIZE
The default list size to use for collecting results when the result size is unknown
|
Modifier and Type | Method and Description |
---|---|
static <TSource,TAccumulate> |
aggregate(java.lang.Iterable<TSource> values,
TAccumulate seed,
Functions.Function2<TAccumulate,? super TSource,TAccumulate> function)
Applies an accumulator function over a sequence.
|
static <TSource,TAccumulate,TResult> |
aggregate(java.lang.Iterable<TSource> values,
TAccumulate seed,
Functions.Function2<TAccumulate,? super TSource,TAccumulate> function,
Functions.Function1<TAccumulate,TResult> resultSelector)
Applies an accumulator function over a sequence.
|
static <TSource,TAccumulate> |
aggregate(TSource[] values,
TAccumulate seed,
Functions.Function2<TAccumulate,? super TSource,TAccumulate> function)
Applies an accumulator function over a sequence.
|
static <TSource,TAccumulate,TResult> |
aggregate(TSource[] values,
TAccumulate seed,
Functions.Function2<TAccumulate,? super TSource,TAccumulate> function,
Functions.Function1<TAccumulate,TResult> resultSelector)
Applies an accumulator function over a sequence.
|
static <T> boolean |
all(java.lang.Iterable<T> values,
Predicates.Predicate1<? super T> predicate)
Returns true if a condition is true for all items in a sequence.
|
static <T> boolean |
all(T[] values,
Predicates.Predicate1<? super T> predicate)
Returns true if a condition is true for all items in a sequence.
|
static <T> boolean |
any(java.lang.Iterable<T> values,
Predicates.Predicate1<? super T> predicate)
Returns true if a condition is true for any of the items in a sequence.
|
static <T> boolean |
any(T[] values,
Predicates.Predicate1<? super T> predicate)
Returns true if a condition is true for any of the items in a sequence.
|
static <TSource,TDest> |
cast(java.lang.Iterable<TSource> values,
java.lang.Class<TDest> destinationClass)
Casts a sequence of values of a certain type to a sequence of values of another type.
|
static <TSource,TDest> |
cast(java.lang.Iterable<TSource> values,
java.lang.Class<TDest> destinationClass,
InvalidCastBehaviour castBehaviour)
Casts a sequence of values of a certain type to a sequence of values of another type, using the specified behaviour upon the event of a
cast failure.
|
static <TSource,TDest> |
cast(TSource[] values,
java.lang.Class<TDest> destClass)
Casts an array of values of a certain type to an array of values of another type.
|
static <TSource,TDest> |
cast(TSource[] values,
java.lang.Class<TDest> destClass,
InvalidCastBehaviour castBehaviour)
Casts an array of values of a certain type to an array of values of another type, using the specified behaviour upon the event of a
cast failure.
|
static <T> java.lang.Iterable<T> |
concat(java.lang.Iterable<? extends T>... values)
Concatenates two or more sequences
|
static <T> T[] |
concat(T[]... values)
Concatenates two or more arrays
|
static <T> boolean |
contains(java.lang.Iterable<T> values,
T item)
Returns true if an item is contained in a sequence.
|
static <T> boolean |
contains(java.lang.Iterable<T> values,
T item,
java.util.Comparator<? super T> comparer)
Returns true if an item is contained in a sequence.
|
static <T> boolean |
contains(T[] values,
T item)
Returns true if an item is contained in a sequence.
|
static <T> boolean |
contains(T[] values,
T item,
java.util.Comparator<? super T> comparer)
Returns true if an item is contained in a sequence.
|
static <T> boolean |
containsAll(java.lang.Iterable<T> values,
java.lang.Iterable<T> items)
Returns true if all of the items are contained in the given values.
|
static <T> boolean |
containsAll(java.lang.Iterable<T> values,
java.lang.Iterable<T> items,
java.util.Comparator<? super T> comparer)
Returns true if all of the items are contained in the given values.
|
static <T> boolean |
containsAll(T[] values,
T[] items)
Returns true if all of the items are contained in the given values.
|
static <T> boolean |
containsAll(T[] values,
T[] items,
java.util.Comparator<? super T> comparer)
Returns true if all of the items are contained in the given values.
|
static <T> boolean |
containsAny(java.lang.Iterable<T> values,
java.lang.Iterable<T> items)
Returns true if any of the items are contained in the given values.
|
static <T> boolean |
containsAny(java.lang.Iterable<T> values,
java.lang.Iterable<T> items,
java.util.Comparator<? super T> comparer)
Returns true if any of the items are contained in the given values.
|
static <T> boolean |
containsAny(T[] values,
T[] items)
Returns true if any of the items are contained in the given values.
|
static <T> boolean |
containsAny(T[] values,
T[] items,
java.util.Comparator<? super T> comparer)
Returns true if any of the items are contained in the given values.
|
static <T> int |
count(java.lang.Iterable<T> values)
Counts an Iterable in the most efficient manner possible.
|
static <T> int |
count(java.lang.Iterable<T> values,
T item)
Returns the number of occurrences of an object in a sequence.
|
static <T> int |
count(java.lang.Iterable<T> values,
T item,
java.util.Comparator<? super T> comparer)
Returns the number of occurrences of an object in a sequence.
|
static <T> int |
count(T[] array)
Returns the array length.
|
static <T> int |
count(T[] values,
T item)
Returns the number of occurrences of an object in a sequence.
|
static <T> int |
count(T[] values,
T item,
java.util.Comparator<? super T> comparer)
Returns the number of occurrences of an object in a sequence.
|
static <T> int |
countWhere(java.lang.Iterable<? extends T> values,
Predicates.Predicate1<? super T> predicate)
Returns the number of occurrences that satisfy the given condition.
|
static <T> int |
countWhere(T[] values,
Predicates.Predicate1<? super T> predicate)
Returns the number of occurrences that satisfy the given condition.
|
static <T> java.lang.Iterable<T> |
defaultIfEmpty(java.lang.Iterable<T> values)
Returns the sequence if at least one element exists in it, otherwise returns a collection consisting of a single element which has a
null value.
|
static <T> T[] |
defaultIfEmpty(T[] values)
Returns the sequence if at least one element exists in it, otherwise returns a collection consisting of a single element which has a
null value.
|
static <T> java.lang.String |
delimit(java.lang.Iterable<T> values,
java.lang.String delimiter)
Concatenates the given values using their toString() method and appending the given delimiter between all values.
|
static <T> java.lang.String |
delimit(java.lang.Iterable<T> values,
java.lang.String delimiter,
java.lang.String nullReplacementValue)
Concatenates the given values using their ToString method and appending the given delimiter between all values.
|
static <T> java.lang.String |
delimit(T[] values,
java.lang.String delimiter)
Concatenates the given values using their toString() method and appending the given delimiter between all values.
|
static <T> java.lang.String |
delimit(T[] values,
java.lang.String delimiter,
java.lang.String nullReplacementValue)
Concatenates the given values using their ToString method and appending the given delimiter between all values.
|
static <T> java.lang.Iterable<T> |
distinct(java.lang.Iterable<T> values)
Returns distinct (i.e.
|
static <T> java.lang.Iterable<T> |
distinct(java.lang.Iterable<T> values,
java.util.Comparator<? super T> comparer)
Returns distinct (i.e.
|
static <T> T[] |
distinct(T[] values)
Returns distinct (i.e.
|
static <T> T[] |
distinct(T[] values,
java.util.Comparator<? super T> comparer)
Returns distinct (i.e.
|
static <T> T |
elementAt(java.lang.Iterable<T> values,
int index)
Returns the element at the given position in the provided sequence.
|
static <T> T |
elementAtOrDefault(java.lang.Iterable<T> values,
int index)
Returns the element at the given position in the provided sequence.
|
static <T> T |
elementAtOrDefault(T[] values,
int index)
Returns the element at the given position in the provided sequence.
|
static <T> java.lang.Iterable<T> |
except(java.lang.Iterable<T> values,
java.lang.Iterable<T> removedValues)
Returns all distinct values except the specified removed values.
|
static <T> java.lang.Iterable<T> |
except(java.lang.Iterable<T> values,
java.lang.Iterable<T> removedValues,
java.util.Comparator<? super T> comparer)
Returns all distinct values except the specified removed values.
|
static <T> T[] |
except(T[] values,
T[] removedValues)
Returns all distinct values except the specified removed values.
|
static <T> T[] |
except(T[] values,
T[] removedValues,
java.util.Comparator<? super T> comparer)
Returns all distinct values except the specified removed values.
|
static <T> T |
first(java.lang.Iterable<T> values)
Returns the first element in the provided sequence.
|
static <T> T |
first(java.lang.Iterable<T> values,
Predicates.Predicate1<? super T> predicate)
Returns the first element in the provided sequence that matches a condition.
|
static <T> T |
first(T[] values)
Returns the first element in the provided sequence.
|
static <T> T |
first(T[] values,
Predicates.Predicate1<? super T> predicate)
Returns the first element in the provided sequence that matches a condition.
|
static <T> T |
firstOrDefault(java.lang.Iterable<T> values)
Returns the first element in the provided sequence.
|
static <T> T |
firstOrDefault(java.lang.Iterable<T> values,
Predicates.Predicate1<? super T> predicate)
Returns the first element in the provided sequence that matches a condition.
|
static <T> T |
firstOrDefault(T[] values)
Returns the first element in the provided array.
|
static <T> T |
firstOrDefault(T[] values,
Predicates.Predicate1<? super T> predicate)
Returns the first element in the provided sequence that matches a condition.
|
static <T> java.lang.Iterable<T> |
forAll(java.lang.Iterable<T> values,
Actions.Action1<T> action)
Executes an action against all elements, returning them
|
static <T> T[] |
forAll(T[] values,
Actions.Action1<T> action)
Executes an action against all elements, returning them
|
static <TKey,TResult> |
groupBy(java.lang.Iterable<TResult> values,
Functions.Function1<? super TResult,TKey> keySelector)
Groups elements by a specified key.
|
static <TKey,TResult> |
groupBy(java.lang.Iterable<TResult> values,
Functions.Function1<? super TResult,TKey> keySelector,
java.util.Comparator<? super TKey> comparer)
Groups elements by a specified key and comparer.
|
static <TKey,TResult> |
groupBy(TResult[] values,
Functions.Function1<TResult,TKey> keySelector)
Groups elements by a specified key.
|
static <TKey,TResult> |
groupBy(TResult[] values,
Functions.Function1<TResult,TKey> keySelector,
java.util.Comparator<? super TKey> comparer)
Groups elements by a specified key and comparer.
|
static <T> int |
indexOf(java.lang.Iterable<T> values,
T element)
Returns the index where the specified element is first found.
|
static <T> int |
indexOf(java.lang.Iterable<T> values,
T element,
java.util.Comparator<? super T> comparer)
Returns the index where the specified element is first found.
|
static <T> int |
indexOf(T[] values,
T element)
Returns the index where the specified element is first found.
|
static <T> int |
indexOf(T[] values,
T element,
java.util.Comparator<? super T> comparer)
Returns the index where the specified element is first found.
|
static <T> java.lang.Iterable<T> |
intersect(java.lang.Iterable<T> first,
java.lang.Iterable<T> second)
Returns the intersection of the distinct elements of two sequences.
|
static <T> java.lang.Iterable<T> |
intersect(java.lang.Iterable<T> first,
java.lang.Iterable<T> second,
java.util.Comparator<? super T> comparer)
Returns the intersection of the distinct elements of two sequences.
|
static <T> T[] |
intersect(T[] first,
T[] second)
Returns the intersection of the distinct elements of two sequences.
|
static <T> T[] |
intersect(T[] first,
T[] second,
java.util.Comparator<? super T> comparer)
Returns the intersection of the distinct elements of two sequences.
|
static <T> boolean |
isEmpty(java.lang.Iterable<T> values)
Returns true if the sequence is empty.
|
static <T> boolean |
isEmpty(T[] values)
Returns true if the array is empty.
|
static <TOuter,TInner,TKey extends java.lang.Comparable<TKey>,TResult> |
join(java.lang.Iterable<TOuter> outerValues,
java.lang.Iterable<TInner> innerValues,
Functions.Function1<TOuter,TKey> outerKeySelector,
Functions.Function1<TInner,TKey> innerKeySelector,
Functions.Function2<TOuter,TInner,TResult> resultSelector)
Performs an inner join (more specifically an equi-join) over two sequences.
|
static <TOuter,TInner,TKey extends java.lang.Comparable<TKey>,TResult> |
join(TOuter[] outerValues,
TInner[] innerValues,
Functions.Function1<TOuter,TKey> outerKeySelector,
Functions.Function1<TInner,TKey> innerKeySelector,
Functions.Function2<TOuter,TInner,TResult> resultSelector)
Performs an inner join (more specifically an equi-join) over two sequences.
|
static <T> T |
last(java.lang.Iterable<T> values)
Returns the last element in the iterable.
|
static <T> T |
last(java.lang.Iterable<T> values,
Predicates.Predicate1<? super T> predicate)
Returns the last element in the provided sequence that matches a condition.
|
static <T> T |
last(T[] array)
Returns the last element in the array.
|
static <T> T |
last(T[] values,
Predicates.Predicate1<? super T> predicate)
Returns the last element in the provided sequence that matches a condition.
|
static <T> int |
lastIndexOf(java.lang.Iterable<? super T> values,
T element)
Returns the last index where the specified element is found.
|
static <T> int |
lastIndexOf(java.lang.Iterable<T> values,
T element,
java.util.Comparator<? super T> comparer)
Returns the last index where the specified element is found.
|
static <T> int |
lastIndexOf(T[] values,
T element)
Returns the last index where the specified element is first found.
|
static <T> int |
lastIndexOf(T[] values,
T element,
java.util.Comparator<? super T> comparer)
Returns the last index where the specified element is first found.
|
static <T> T |
lastOrDefault(java.lang.Iterable<T> values)
Returns the last element in the provided sequence.
|
static <T> T |
lastOrDefault(java.lang.Iterable<T> values,
Predicates.Predicate1<? super T> predicate)
Returns the last element in the provided sequence that matches a condition.
|
static <T> T |
lastOrDefault(T[] values)
Returns the last element in the provided array.
|
static <T> T |
lastOrDefault(T[] values,
Predicates.Predicate1<? super T> predicate)
Returns the last element in the provided sequence that matches a condition.
|
static int |
max(int[] items)
Returns the maximum of the given values.
|
static long |
max(long[] items)
Returns the maximum of the given values.
|
static <T extends java.lang.Comparable<T>> |
max(T[] items)
Returns the maximum of the given values.
|
static <T> T |
maxOccurring(java.lang.Iterable<T> items)
Returns the item with the most occurrences in the given iterable.
|
static <T> T |
maxOccurring(java.lang.Iterable<T> items,
java.util.Comparator<? super T> comparator)
Returns the item with the most occurrences in the given iterable.
|
static <T> T |
maxOccurring(T[] items)
Returns the item with the most occurrences in the given array.
|
static <T> T |
maxOccurring(T[] items,
java.util.Comparator<? super T> comparator)
Returns the item with the most occurrences in the given array.
|
static int |
min(int[] items)
Returns the minimum of the given values.
|
static long |
min(long[] items)
Returns the minimum of the given values.
|
static <T extends java.lang.Comparable<T>> |
min(T[] items)
Returns the minimum of the given values.
|
static <T> T |
minOccurring(java.lang.Iterable<T> items)
Returns the item with the least occurrences in the given iterable.
|
static <T> T |
minOccurring(java.lang.Iterable<T> items,
java.util.Comparator<? super T> comparator)
Returns the item with the least occurrences in the given iterable.
|
static <T> T |
minOccurring(T[] items)
Returns the item with the least occurrences in the given array.
|
static <T> T |
minOccurring(T[] items,
java.util.Comparator<? super T> comparator)
Returns the item with the least occurrences in the given array.
|
static <TSource,TDest> |
ofType(java.lang.Iterable<TSource> values,
java.lang.Class<TDest> destinationClass)
Returns all values in a sequence that are of a particular type.
|
static <TSource,TDest> |
ofType(TSource[] values,
java.lang.Class<TDest> destinationClass)
Returns all values in a sequence that are of a particular type.
|
static <TKey extends java.lang.Comparable<TKey>,TResult> |
orderBy(java.lang.Iterable<TResult> values,
Functions.Function1<? super TResult,TKey> keySelector)
Orders a sequence by a specified key.
|
static <TKey extends java.lang.Comparable<TKey>,TResult> |
orderBy(java.lang.Iterable<TResult> values,
Functions.Function1<? super TResult,TKey> keySelector,
java.util.Comparator<? super TKey> comparer)
Orders a sequence by a specified key.
|
static <TKey extends java.lang.Comparable<TKey>,TResult> |
orderBy(TResult[] values,
Functions.Function1<TResult,TKey> keySelector)
Orders a sequence by a specified key.
|
static <TKey,TResult> |
orderBy(TResult[] values,
Functions.Function1<TResult,TKey> keySelector,
java.util.Comparator<? super TKey> comparer)
Orders a sequence by a specified key.
|
static <TKey,TKey2,TResult> |
orderByThenBy(java.lang.Iterable<TResult> values,
Functions.Function1<? super TResult,TKey> keySelector,
java.util.Comparator<? super TKey> comparer,
Functions.Function1<? super TResult,TKey2> keySelector2,
java.util.Comparator<? super TKey2> comparer2)
Orders a sequence by a specified key and matching key results get sorted by a second key.
|
static <TKey extends java.lang.Comparable<TKey>,TKey2 extends java.lang.Comparable<TKey2>,TResult> |
orderByThenBy(java.lang.Iterable<TResult> values,
Functions.Function1<? super TResult,TKey> keySelector,
Functions.Function1<? super TResult,TKey2> keySelector2)
Orders a sequence by a specified key and matching key results get sorted by a second key.
|
static <TKey,TKey2,TResult> |
orderByThenBy(TResult[] values,
Functions.Function1<TResult,TKey> keySelector,
java.util.Comparator<? super TKey> comparer,
Functions.Function1<TResult,TKey2> keySelector2,
java.util.Comparator<? super TKey2> comparer2)
Orders a sequence by a specified key and matching key results get sorted by a second key.
|
static <TKey extends java.lang.Comparable<TKey>,TKey2 extends java.lang.Comparable<TKey2>,TResult> |
orderByThenBy(TResult[] values,
Functions.Function1<TResult,TKey> keySelector,
Functions.Function1<TResult,TKey2> keySelector2)
Orders a sequence by a specified key and matching key results get sorted by a second key.
|
static <T> Pair<java.lang.Iterable<T>,java.lang.Iterable<T>> |
partition(java.lang.Iterable<T> values,
Predicates.Predicate1<? super T> predicate)
Partitions the given values based on a predicate.
|
static <T> Pair<T[],T[]> |
partition(T[] values,
Predicates.Predicate1<T> predicate)
Partitions the given values based on a predicate.
|
static <T> java.lang.Iterable<T> |
range(java.lang.Iterable<T> values,
int start,
int finish)
Returns a range from the provided sequence.
|
static <T> T[] |
range(T[] values,
int start,
int finish)
Returns a range from the provided sequence.
|
static <T> java.lang.Iterable<T> |
range(T start,
Predicates.Predicate1<? super T> predicate,
Functions.Function1<T,T> stepFunction)
Returns a range of values, by using a step function, until the predicate returns false
|
static <T> java.lang.Iterable<T> |
range(T start,
T end,
Functions.Function1<T,T> stepFunction)
Returns a range of values, from start to end (exclusive).
|
static <T> java.lang.Iterable<T> |
repeat(T value,
int count)
Returns a collection of specified size
|
static <T> java.lang.Iterable<T> |
reverse(java.lang.Iterable<T> values)
Returns a reversed version of the provided sequence
|
static <T> java.util.List<T> |
reverse(java.util.List<T> values)
Returns a reversed version of the provided sequence
|
static <T> ReifiedList<T> |
reverse(ReifiedIterable<T> values)
Returns a reversed version of the provided sequence
|
static <T> T[] |
reverse(T[] values)
Returns a reversed version of the provided array
|
static <TSource,TResult> |
select(java.lang.Iterable<TSource> values,
Functions.Function1<? super TSource,TResult> selector)
Acts as a Select LINQ function.
|
static <TSource,TResult> |
select(TSource[] values,
Functions.Function1<TSource,TResult> selector)
Acts as a Select LINQ function.
|
static <TSource,TResult> |
selectMany(java.lang.Iterable<TSource> values,
Functions.Function1<? super TSource,java.util.List<TResult>> selector)
Acts as a SelectMany LINQ function, to allow selection of iterables and return all their sub-items.
|
static <TSource,TResult> |
selectMany(TSource[] values,
Functions.Function1<TSource,ReifiedList<TResult>> selector)
Acts as a SelectMany LINQ function, to allow selection of iterables and return all their sub-items.
|
static <T> boolean |
sequenceEqual(java.lang.Iterable<? super T> values1,
java.lang.Iterable<T> values2)
Returns true if both iterables have the same values in the exact same positions.
|
static <T> boolean |
sequenceEqual(java.util.List<T> a,
int offsetA,
java.util.List<T> b,
int offsetB,
int count)
Returns true if the item sequences within two arrays are equal.
|
static <T> boolean |
sequenceEqual(T[] a,
int offsetA,
T[] b,
int offsetB,
int count)
Returns true if the item sequences within two arrays are equal.
|
static <T> boolean |
sequenceEqual(T[] values1,
T[] values2)
Returns true if both iterables have the same values in the exact same positions.
|
static <T> T |
single(java.lang.Iterable<T> values)
Throws an exception if the given Iterable does not have a single element (e.g.
|
static <T> T |
single(T[] values)
Throws an exception if the given Iterable does not have a single element (e.g.
|
static <T> java.lang.Iterable<T> |
skip(java.lang.Iterable<T> values,
int count)
Skips up to the specified number of elements in the given sequence.
|
static <T> T[] |
skip(T[] values,
int count)
Skips up to the specified number of elements in the given sequence.
|
static <T> java.lang.Iterable<T> |
skipWhile(java.lang.Iterable<T> values,
Predicates.Predicate1<? super T> predicate)
Skips items in the sequence for which a predicate is true, returning the rest.
|
static <T> T[] |
skipWhile(T[] values,
Predicates.Predicate1<T> predicate)
Skips items in the sequence for which a predicate is true, returning the rest.
|
static <T extends java.lang.Comparable<T>> |
sort(java.lang.Iterable<T> values)
Sorts a sequence.
|
static <T> java.util.List<T> |
sort(java.lang.Iterable<T> values,
java.util.Comparator<? super T> comparator)
Sorts a sequence.
|
static <T extends java.lang.Comparable<T>> |
sort(java.util.List<T> values)
Sorts a list
|
static <T extends java.lang.Comparable<T>> |
sort(java.util.List<T> values,
java.util.Comparator<? super T> comparator)
Sorts a list
|
static <T extends java.lang.Comparable<T>> |
sort(ReifiedIterable<T> values)
Sorts a sequence.
|
static <T> java.util.List<T>[] |
split(java.lang.Iterable<? extends T> values,
T delimiter)
Splits a sequence into parts delimited by the specified delimited.
|
static <T> java.util.List<T>[] |
split(java.lang.Iterable<T> values,
T delimiter,
java.util.Comparator<? super T> comparer)
Splits a sequence into parts delimited by the specified delimited.
|
static <T> java.util.List<T>[] |
split(T[] values,
T delimiter)
Splits a sequence into parts delimited by the specified delimited.
|
static <T> java.util.List<T>[] |
split(T[] values,
T delimiter,
java.util.Comparator<? super T> comparer)
Splits a sequence into parts delimited by the specified delimited.
|
static <T> void |
swap(java.util.List<T> list,
int[] a,
int[] b)
Swaps two or more elements in an array
|
static <T> void |
swap(java.util.List<T> list,
int a,
int b)
Swaps two elements in a list
|
static <T> void |
swap(T[] array,
int[] a,
int[] b)
Swaps two or more elements in an array.
|
static <T> void |
swap(T[] array,
int a,
int b)
Swaps two elements in an array.
|
static <T> java.lang.Iterable<T> |
take(java.lang.Iterable<T> values,
int count)
Returns up to the specified number of elements from the given sequence.
|
static <T> T[] |
take(T[] values,
int count)
Returns up to the specified number of elements from the given sequence.
|
static <T> java.lang.Iterable<T> |
takeWhile(java.lang.Iterable<T> values,
Predicates.Predicate1<? super T> predicate)
Returns items in the sequence while a predicate is true.
|
static <T> T[] |
takeWhile(T[] values,
Predicates.Predicate1<? super T> predicate)
Returns items in the sequence while a predicate is true.
|
static <T> T[] |
toArray(java.util.Collection<T> list,
java.lang.Class<?> componentType)
Converts a collection to an array.
|
static <T> T[] |
toArray(java.util.Enumeration<T> enumeration,
java.lang.Class<?> componentType)
Converts an enumeration to an array.
|
static <T> T[] |
toArray(java.lang.Iterable<T> values,
java.lang.Class<?> componentType)
Converts an iterable to an array.
|
static <T> T[] |
toArray(ReifiedIterable<T> values)
Converts an iterable to an array.
|
static <T> T[] |
toArray(ReifiedList<T> list)
Converts a list to an array.
|
static <T,TKey extends java.lang.Comparable<TKey>,TValue> |
toAvlHashtable(java.lang.Iterable<T> values,
Functions.Function1<T,TKey> keySelector,
Functions.Function1<T,TValue> valueSelector)
Converts a sequence of items into a key/value AVL tree.
|
static <T,TKey extends java.lang.Comparable<TKey>,TValue> |
toAvlHashtable(T[] values,
Functions.Function1<T,TKey> keySelector,
Functions.Function1<T,TValue> valueSelector)
Converts a sequence of items into a key/value AVL hashtable.
|
static <T> java.util.List<T> |
toList(java.util.Enumeration<? extends T> enumeration)
Converts an enumeration to a list
|
static <T> ReifiedList<T> |
toList(java.util.Enumeration<T> enumeration,
java.lang.Class<?> genericTypeParameter)
Converts an enumeration to a list
|
static <T> java.util.List<T> |
toList(java.lang.Iterable<? extends T> values)
Converts an Iterable to a list
|
static <T> ReifiedList<T> |
toList(java.lang.Iterable<T> values,
java.lang.Class<?> genericTypeParameter)
Converts an iterable to a list
|
static <T> ReifiedList<T> |
toList(ReifiedIterable<T> values)
Converts an iterable to a list
|
static <T> ReifiedList<T> |
toList(T[] values)
Converts an array to a list
|
static <T> java.lang.String |
toString(java.lang.Iterable<T> iterable)
Returns a toString() of the given collection
|
static <T> java.lang.String |
toString(T[] iterable)
Returns a toString() of the given array
|
static <T> java.lang.Iterable<T> |
union(java.lang.Iterable<T> first,
java.lang.Iterable<T> second)
Produces the union of two sequences.
|
static <T> java.lang.Iterable<T> |
union(java.lang.Iterable<T> first,
java.lang.Iterable<T> second,
java.util.Comparator<? super T> comparer)
Produces the union of two sequences.
|
static <T> T[] |
union(T[] first,
T[] second)
Produces the union of two sequences.
|
static <T> T[] |
union(T[] first,
T[] second,
java.util.Comparator<? super T> comparer)
Produces the union of two sequences.
|
static <T,TResult1,TResult2> |
unzip(java.lang.Iterable<T> values,
Functions.Function1<? super T,Pair<TResult1,TResult2>> func)
Performs the reverse operation to zip()
|
static <T,TResult1,TResult2> |
unzip(T[] values,
Functions.Function1<T,Pair<TResult1,TResult2>> func)
Performs the reverse operation to zip()
|
static <T> java.lang.Iterable<T> |
where(java.lang.Iterable<T> values,
Predicates.Predicate1<? super T> predicate)
Returns a subset of the provided sequence, which conforms to the given predicate i.e.
|
static <T> T[] |
where(T[] values,
Predicates.Predicate1<? super T> predicate)
Returns a subset of the provided sequence, which conforms to the given predicate i.e.
|
static <TFirst,TSecond,TResult> |
zip(java.lang.Iterable<TFirst> first,
java.lang.Iterable<TSecond> second,
Functions.Function2<TFirst,TSecond,TResult> function)
Merges two sequences by using the specified predicate function.
|
static <TFirst,TSecond,TResult> |
zip(TFirst[] first,
TSecond[] second,
Functions.Function2<TFirst,TSecond,TResult> function)
Merges two sequences by using the specified predicate function.
|
public static final int DEFAULT_LIST_SIZE
public static <TSource,TAccumulate> TAccumulate aggregate(java.lang.Iterable<TSource> values, TAccumulate seed, Functions.Function2<TAccumulate,? super TSource,TAccumulate> function)
java.lang.NullPointerException
- An argument is null.public static <TSource,TAccumulate> TAccumulate aggregate(TSource[] values, TAccumulate seed, Functions.Function2<TAccumulate,? super TSource,TAccumulate> function)
java.lang.NullPointerException
- An argument is null.public static <TSource,TAccumulate,TResult> TResult aggregate(java.lang.Iterable<TSource> values, TAccumulate seed, Functions.Function2<TAccumulate,? super TSource,TAccumulate> function, Functions.Function1<TAccumulate,TResult> resultSelector)
java.lang.NullPointerException
- An argument is null.public static <TSource,TAccumulate,TResult> TResult aggregate(TSource[] values, TAccumulate seed, Functions.Function2<TAccumulate,? super TSource,TAccumulate> function, Functions.Function1<TAccumulate,TResult> resultSelector)
java.lang.NullPointerException
- An argument is null.public static <T> boolean all(java.lang.Iterable<T> values, Predicates.Predicate1<? super T> predicate)
java.lang.NullPointerException
- When an argument is null.public static <T> boolean all(T[] values, Predicates.Predicate1<? super T> predicate)
java.lang.NullPointerException
- When an argument is null.public static <T> boolean any(java.lang.Iterable<T> values, Predicates.Predicate1<? super T> predicate)
java.lang.NullPointerException
- An argument is null.public static <T> boolean any(T[] values, Predicates.Predicate1<? super T> predicate)
java.lang.NullPointerException
- An argument is null.public static <TSource,TDest> java.lang.Iterable<TDest> cast(java.lang.Iterable<TSource> values, java.lang.Class<TDest> destinationClass)
java.lang.NullPointerException
- When an argument is null.public static <TSource,TDest> TDest[] cast(TSource[] values, java.lang.Class<TDest> destClass)
java.lang.NullPointerException
- When an argument is null.public static <TSource,TDest> java.lang.Iterable<TDest> cast(java.lang.Iterable<TSource> values, java.lang.Class<TDest> destinationClass, InvalidCastBehaviour castBehaviour)
java.lang.NullPointerException
- When an argument is null.java.lang.IllegalArgumentException
- Unrecognized cast behaviour.public static <TSource,TDest> TDest[] cast(TSource[] values, java.lang.Class<TDest> destClass, InvalidCastBehaviour castBehaviour)
java.lang.NullPointerException
- When an argument is null.java.lang.IllegalArgumentException
- Unrecognized cast behaviour.public static <T> java.lang.Iterable<T> concat(java.lang.Iterable<? extends T>... values)
java.lang.NullPointerException
- When the values or one of its (Iterable<T>) elements is null.public static <T> T[] concat(T[]... values)
java.lang.NullPointerException
- When the values or one of its elements is null.public static <T> boolean contains(java.lang.Iterable<T> values, T item)
java.lang.NullPointerException
- When the values argument is null.public static <T> boolean contains(java.lang.Iterable<T> values, T item, java.util.Comparator<? super T> comparer)
java.lang.NullPointerException
- When the values argument or the comparer is null.public static <T> boolean contains(T[] values, T item)
java.lang.NullPointerException
- When the values argument is null.public static <T> boolean contains(T[] values, T item, java.util.Comparator<? super T> comparer)
java.lang.NullPointerException
- When the array or the comparer is null.public static <T> boolean containsAny(java.lang.Iterable<T> values, java.lang.Iterable<T> items)
java.lang.NullPointerException
- When an argument is null.public static <T> boolean containsAny(java.lang.Iterable<T> values, java.lang.Iterable<T> items, java.util.Comparator<? super T> comparer)
java.lang.NullPointerException
- When an argument is null.public static <T> boolean containsAny(T[] values, T[] items)
java.lang.NullPointerException
- When an argument is null.public static <T> boolean containsAny(T[] values, T[] items, java.util.Comparator<? super T> comparer)
java.lang.NullPointerException
- When an argument is null.public static <T> boolean containsAll(java.lang.Iterable<T> values, java.lang.Iterable<T> items)
java.lang.NullPointerException
- When an argument is null.public static <T> boolean containsAll(java.lang.Iterable<T> values, java.lang.Iterable<T> items, java.util.Comparator<? super T> comparer)
java.lang.NullPointerException
- When an argument is null.public static <T> boolean containsAll(T[] values, T[] items)
java.lang.NullPointerException
- When an argument is null.public static <T> boolean containsAll(T[] values, T[] items, java.util.Comparator<? super T> comparer)
java.lang.NullPointerException
- When an argument is null.public static <T> int count(java.lang.Iterable<T> values)
java.lang.NullPointerException
- When an argument is null.public static <T> int count(T[] array)
java.lang.NullPointerException
- When an argument is null.public static <T> int count(java.lang.Iterable<T> values, T item)
java.lang.NullPointerException
- When the values argument is null.public static <T> int count(java.lang.Iterable<T> values, T item, java.util.Comparator<? super T> comparer)
java.lang.NullPointerException
- When the values argument or the comparer is null.public static <T> int count(T[] values, T item)
java.lang.NullPointerException
- When the values argument is null.public static <T> int count(T[] values, T item, java.util.Comparator<? super T> comparer)
java.lang.NullPointerException
- When the values argument is null.public static <T> int countWhere(java.lang.Iterable<? extends T> values, Predicates.Predicate1<? super T> predicate)
java.lang.NullPointerException
- When an argument is null.public static <T> int countWhere(T[] values, Predicates.Predicate1<? super T> predicate)
java.lang.NullPointerException
- When an argument is null.public static <T> java.lang.Iterable<T> defaultIfEmpty(java.lang.Iterable<T> values)
java.lang.NullPointerException
- When an argument is null.public static <T> T[] defaultIfEmpty(T[] values)
java.lang.NullPointerException
- When an argument is null.public static <T> java.lang.String delimit(java.lang.Iterable<T> values, java.lang.String delimiter)
java.lang.NullPointerException
- An argument is null.public static <T> java.lang.String delimit(java.lang.Iterable<T> values, java.lang.String delimiter, java.lang.String nullReplacementValue)
java.lang.NullPointerException
- An argument is null.public static <T> java.lang.String delimit(T[] values, java.lang.String delimiter)
java.lang.NullPointerException
- An argument is null.public static <T> java.lang.String delimit(T[] values, java.lang.String delimiter, java.lang.String nullReplacementValue)
java.lang.NullPointerException
- An argument is null.public static <T> java.lang.Iterable<T> distinct(java.lang.Iterable<T> values)
java.lang.NullPointerException
- When an argument is null.public static <T> T[] distinct(T[] values)
java.lang.NullPointerException
- When an argument is null.public static <T> java.lang.Iterable<T> distinct(java.lang.Iterable<T> values, java.util.Comparator<? super T> comparer)
java.lang.NullPointerException
- When the values argument is null.public static <T> T[] distinct(T[] values, java.util.Comparator<? super T> comparer)
java.lang.NullPointerException
- When the values argument is null.public static <T> T elementAt(java.lang.Iterable<T> values, int index)
java.lang.NullPointerException
- When the values argument is null.java.lang.IndexOutOfBoundsException
- When the index is out of range.public static <T> T elementAtOrDefault(java.lang.Iterable<T> values, int index)
java.lang.NullPointerException
- When the values argument is null.public static <T> T elementAtOrDefault(T[] values, int index)
java.lang.NullPointerException
- When the values argument is null.public static <T> java.lang.Iterable<T> except(java.lang.Iterable<T> values, java.lang.Iterable<T> removedValues)
java.lang.NullPointerException
- When an argument is null.public static <T> java.lang.Iterable<T> except(java.lang.Iterable<T> values, java.lang.Iterable<T> removedValues, java.util.Comparator<? super T> comparer)
java.lang.NullPointerException
- When the values or removedValues argument is null.public static <T> T[] except(T[] values, T[] removedValues)
java.lang.NullPointerException
- When an argument is null.public static <T> T[] except(T[] values, T[] removedValues, java.util.Comparator<? super T> comparer)
java.lang.NullPointerException
- When the values or removedValues argument is null.public static <T> T first(java.lang.Iterable<T> values)
java.lang.NullPointerException
- When an argument is null.java.util.NoSuchElementException
- There is no first element.public static <T> T first(T[] values)
java.lang.NullPointerException
- When an argument is null.java.util.NoSuchElementException
- There is no first element.public static <T> T first(java.lang.Iterable<T> values, Predicates.Predicate1<? super T> predicate)
java.lang.NullPointerException
- When an argument is null.java.util.NoSuchElementException
- There is no match to the given predicate.public static <T> T first(T[] values, Predicates.Predicate1<? super T> predicate)
java.lang.NullPointerException
- When an argument is null.java.util.NoSuchElementException
- There is no match to the given predicate.public static <T> T firstOrDefault(java.lang.Iterable<T> values)
java.lang.NullPointerException
- When an argument is null.public static <T> T firstOrDefault(java.lang.Iterable<T> values, Predicates.Predicate1<? super T> predicate)
java.lang.NullPointerException
- When an argument is null.public static <T> T firstOrDefault(T[] values)
java.lang.NullPointerException
- When an argument is null.public static <T> T firstOrDefault(T[] values, Predicates.Predicate1<? super T> predicate)
java.lang.NullPointerException
- When an argument is null.public static <T> T[] forAll(T[] values, Actions.Action1<T> action)
java.lang.NullPointerException
- When an argument is null.public static <T> java.lang.Iterable<T> forAll(java.lang.Iterable<T> values, Actions.Action1<T> action)
java.lang.NullPointerException
- When an argument is null.public static <TKey,TResult> java.lang.Iterable<TResult> groupBy(java.lang.Iterable<TResult> values, Functions.Function1<? super TResult,TKey> keySelector)
java.lang.NullPointerException
- When an argument is null.public static <TKey,TResult> TResult[] groupBy(TResult[] values, Functions.Function1<TResult,TKey> keySelector)
java.lang.NullPointerException
- When an argument is null.public static <TKey,TResult> java.lang.Iterable<TResult> groupBy(java.lang.Iterable<TResult> values, Functions.Function1<? super TResult,TKey> keySelector, java.util.Comparator<? super TKey> comparer)
java.lang.NullPointerException
- When the values argument or the key selector is null.public static <TKey,TResult> TResult[] groupBy(TResult[] values, Functions.Function1<TResult,TKey> keySelector, java.util.Comparator<? super TKey> comparer)
java.lang.NullPointerException
- When the values argument or the key selector is null.public static <T> int indexOf(java.lang.Iterable<T> values, T element)
java.lang.NullPointerException
- When the values argument is null.public static <T> int indexOf(java.lang.Iterable<T> values, T element, java.util.Comparator<? super T> comparer)
java.lang.NullPointerException
- When the values or the comparer argument is null.public static <T> int indexOf(T[] values, T element)
java.lang.NullPointerException
- When the values argument is null.public static <T> int indexOf(T[] values, T element, java.util.Comparator<? super T> comparer)
java.lang.NullPointerException
- When the values argument is null.public static <T> java.lang.Iterable<T> intersect(java.lang.Iterable<T> first, java.lang.Iterable<T> second)
java.lang.NullPointerException
- When an argument is null.public static <T> java.lang.Iterable<T> intersect(java.lang.Iterable<T> first, java.lang.Iterable<T> second, java.util.Comparator<? super T> comparer)
java.lang.NullPointerException
- When the first or second argument is null.public static <T> T[] intersect(T[] first, T[] second)
java.lang.NullPointerException
- When an argument is null.public static <T> T[] intersect(T[] first, T[] second, java.util.Comparator<? super T> comparer)
java.lang.NullPointerException
- When the first or second argument is null.public static <T> boolean isEmpty(java.lang.Iterable<T> values)
java.lang.NullPointerException
- Is the argument is null.public static <T> boolean isEmpty(T[] values)
java.lang.NullPointerException
- Is the argument is null.public static <TOuter,TInner,TKey extends java.lang.Comparable<TKey>,TResult> java.lang.Iterable<TResult> join(java.lang.Iterable<TOuter> outerValues, java.lang.Iterable<TInner> innerValues, Functions.Function1<TOuter,TKey> outerKeySelector, Functions.Function1<TInner,TKey> innerKeySelector, Functions.Function2<TOuter,TInner,TResult> resultSelector)
java.lang.NullPointerException
- If an argument is null.public static <TOuter,TInner,TKey extends java.lang.Comparable<TKey>,TResult> TResult[] join(TOuter[] outerValues, TInner[] innerValues, Functions.Function1<TOuter,TKey> outerKeySelector, Functions.Function1<TInner,TKey> innerKeySelector, Functions.Function2<TOuter,TInner,TResult> resultSelector)
java.lang.NullPointerException
- If an argument is null.public static <T> T last(java.lang.Iterable<T> values)
java.lang.NullPointerException
- If the array is nulljava.util.NoSuchElementException
- If the iterable is emptypublic static <T> T last(T[] array)
java.lang.NullPointerException
- If the array is nulljava.util.NoSuchElementException
- If the array is emptypublic static <T> T last(java.lang.Iterable<T> values, Predicates.Predicate1<? super T> predicate)
java.lang.NullPointerException
- The values argument is null.java.util.NoSuchElementException
- There is no match to the given predicatepublic static <T> T last(T[] values, Predicates.Predicate1<? super T> predicate)
java.lang.NullPointerException
- The values argument is null.java.util.NoSuchElementException
- There is no match to the given predicatepublic static <T> T lastOrDefault(java.lang.Iterable<T> values)
java.lang.NullPointerException
- When an argument is null.public static <T> T lastOrDefault(T[] values)
java.lang.NullPointerException
- When an argument is null.public static <T> T lastOrDefault(java.lang.Iterable<T> values, Predicates.Predicate1<? super T> predicate)
java.lang.NullPointerException
- When an argument is null.public static <T> T lastOrDefault(T[] values, Predicates.Predicate1<? super T> predicate)
java.lang.NullPointerException
- When an argument is null.public static <T> int lastIndexOf(java.lang.Iterable<? super T> values, T element)
java.lang.NullPointerException
- If the values argument is null.public static <T> int lastIndexOf(java.lang.Iterable<T> values, T element, java.util.Comparator<? super T> comparer)
java.lang.NullPointerException
- If the values or comparer argument is null.public static <T> int lastIndexOf(T[] values, T element)
java.lang.NullPointerException
- If the values argument is null.public static <T> int lastIndexOf(T[] values, T element, java.util.Comparator<? super T> comparer)
java.lang.NullPointerException
- If the values or comparer argument is null.public static <T extends java.lang.Comparable<T>> T max(T[] items)
java.lang.NullPointerException
- An argument is nullpublic static int max(int[] items)
java.lang.NullPointerException
- An argument is nullpublic static long max(long[] items)
java.lang.NullPointerException
- An argument is nullpublic static <T extends java.lang.Comparable<T>> T min(T[] items)
java.lang.NullPointerException
- An argument is nullpublic static int min(int[] items)
java.lang.NullPointerException
- An argument is nullpublic static long min(long[] items)
java.lang.NullPointerException
- An argument is nullpublic static <T> T maxOccurring(T[] items)
java.lang.NullPointerException
- An argument is nullpublic static <T> T maxOccurring(T[] items, java.util.Comparator<? super T> comparator)
java.lang.NullPointerException
- An argument is nullpublic static <T> T maxOccurring(java.lang.Iterable<T> items)
java.lang.NullPointerException
- An argument is nullpublic static <T> T maxOccurring(java.lang.Iterable<T> items, java.util.Comparator<? super T> comparator)
java.lang.NullPointerException
- An argument is nullpublic static <T> T minOccurring(T[] items)
java.lang.NullPointerException
- An argument is nullpublic static <T> T minOccurring(T[] items, java.util.Comparator<? super T> comparator)
java.lang.NullPointerException
- An argument is nullpublic static <T> T minOccurring(java.lang.Iterable<T> items)
java.lang.NullPointerException
- An argument is nullpublic static <T> T minOccurring(java.lang.Iterable<T> items, java.util.Comparator<? super T> comparator)
java.lang.NullPointerException
- An argument is nullpublic static <TSource,TDest> java.lang.Iterable<TDest> ofType(java.lang.Iterable<TSource> values, java.lang.Class<TDest> destinationClass)
java.lang.NullPointerException
- When the argument is null.public static <TSource,TDest> TDest[] ofType(TSource[] values, java.lang.Class<TDest> destinationClass)
java.lang.NullPointerException
- When the argument is null.public static <TKey extends java.lang.Comparable<TKey>,TResult> java.lang.Iterable<TResult> orderBy(java.lang.Iterable<TResult> values, Functions.Function1<? super TResult,TKey> keySelector)
java.lang.NullPointerException
- When an argument is null.public static <TKey extends java.lang.Comparable<TKey>,TResult> ReifiedList<TResult> orderBy(java.lang.Iterable<TResult> values, Functions.Function1<? super TResult,TKey> keySelector, java.util.Comparator<? super TKey> comparer)
java.lang.NullPointerException
- When the values or keySelector argument is null.public static <TKey,TResult> TResult[] orderBy(TResult[] values, Functions.Function1<TResult,TKey> keySelector, java.util.Comparator<? super TKey> comparer)
java.lang.NullPointerException
- When the values or keySelector argument is null.public static <TKey extends java.lang.Comparable<TKey>,TResult> TResult[] orderBy(TResult[] values, Functions.Function1<TResult,TKey> keySelector)
java.lang.NullPointerException
- When an argument is null.public static <TKey extends java.lang.Comparable<TKey>,TKey2 extends java.lang.Comparable<TKey2>,TResult> java.lang.Iterable<TResult> orderByThenBy(java.lang.Iterable<TResult> values, Functions.Function1<? super TResult,TKey> keySelector, Functions.Function1<? super TResult,TKey2> keySelector2)
java.lang.NullPointerException
- When an argument is null.public static <TKey extends java.lang.Comparable<TKey>,TKey2 extends java.lang.Comparable<TKey2>,TResult> TResult[] orderByThenBy(TResult[] values, Functions.Function1<TResult,TKey> keySelector, Functions.Function1<TResult,TKey2> keySelector2)
java.lang.NullPointerException
- When an argument is null.public static <TKey,TKey2,TResult> java.lang.Iterable<TResult> orderByThenBy(java.lang.Iterable<TResult> values, Functions.Function1<? super TResult,TKey> keySelector, java.util.Comparator<? super TKey> comparer, Functions.Function1<? super TResult,TKey2> keySelector2, java.util.Comparator<? super TKey2> comparer2)
java.lang.NullPointerException
- When an argument is null.public static <TKey,TKey2,TResult> TResult[] orderByThenBy(TResult[] values, Functions.Function1<TResult,TKey> keySelector, java.util.Comparator<? super TKey> comparer, Functions.Function1<TResult,TKey2> keySelector2, java.util.Comparator<? super TKey2> comparer2)
java.lang.NullPointerException
- When an argument is null.public static <T> Pair<java.lang.Iterable<T>,java.lang.Iterable<T>> partition(java.lang.Iterable<T> values, Predicates.Predicate1<? super T> predicate)
java.lang.NullPointerException
- The values argument is null.public static <T> Pair<T[],T[]> partition(T[] values, Predicates.Predicate1<T> predicate)
java.lang.NullPointerException
- The values argument is null.public static <T> java.lang.Iterable<T> range(java.lang.Iterable<T> values, int start, int finish)
java.lang.NullPointerException
- The values argument is null.java.lang.IndexOutOfBoundsException
- An index is out of range.public static <T> T[] range(T[] values, int start, int finish)
java.lang.NullPointerException
- The values argument is null.java.lang.IndexOutOfBoundsException
- An index is out of range.public static <T> java.lang.Iterable<T> range(T start, T end, Functions.Function1<T,T> stepFunction)
java.lang.NullPointerException
- The step function argument is null.public static <T> java.lang.Iterable<T> range(T start, Predicates.Predicate1<? super T> predicate, Functions.Function1<T,T> stepFunction)
java.lang.NullPointerException
- The predicate or step function argument is null.public static <T> java.lang.Iterable<T> repeat(T value, int count)
java.lang.IllegalArgumentException
- The count is out of range.java.lang.NullPointerException
- When the destination class is null.public static <T> java.util.List<T> reverse(java.util.List<T> values)
java.lang.NullPointerException
- When the argument is null.public static <T> java.lang.Iterable<T> reverse(java.lang.Iterable<T> values)
java.lang.NullPointerException
- When the argument is null.public static <T> ReifiedList<T> reverse(ReifiedIterable<T> values)
java.lang.NullPointerException
- When the argument is null.public static <T> T[] reverse(T[] values)
java.lang.NullPointerException
- When the argument is null.public static <TSource,TResult> java.lang.Iterable<TResult> select(java.lang.Iterable<TSource> values, Functions.Function1<? super TSource,TResult> selector)
java.lang.NullPointerException
- When an argument is null.public static <TSource,TResult> TResult[] select(TSource[] values, Functions.Function1<TSource,TResult> selector)
java.lang.NullPointerException
- When an argument is null.public static <TSource,TResult> java.lang.Iterable<TResult> selectMany(java.lang.Iterable<TSource> values, Functions.Function1<? super TSource,java.util.List<TResult>> selector)
java.lang.NullPointerException
- When an argument is null.public static <TSource,TResult> TResult[] selectMany(TSource[] values, Functions.Function1<TSource,ReifiedList<TResult>> selector)
java.lang.NullPointerException
- When an argument is null.java.lang.IllegalArgumentException
- When the run-time type of the resulting array cannot be determined.public static <T> boolean sequenceEqual(java.lang.Iterable<? super T> values1, java.lang.Iterable<T> values2)
java.lang.NullPointerException
- An argument is nullpublic static <T> boolean sequenceEqual(java.util.List<T> a, int offsetA, java.util.List<T> b, int offsetB, int count)
java.lang.NullPointerException
- An array is nulljava.lang.IllegalArgumentException
- Length is out of range.java.lang.IndexOutOfBoundsException
- Offsets are out of range.java.lang.ArithmeticException
- When very large numbers are used and overflow occurs.public static <T> boolean sequenceEqual(T[] values1, T[] values2)
java.lang.NullPointerException
- An argument is nullpublic static <T> boolean sequenceEqual(T[] a, int offsetA, T[] b, int offsetB, int count)
java.lang.NullPointerException
- An array is nulljava.lang.IllegalArgumentException
- Length is out of range.java.lang.IndexOutOfBoundsException
- Offsets are out of range.java.lang.ArithmeticException
- When very large numbers are used and overflow occurs.public static <T> T single(T[] values)
java.lang.NullPointerException
- When the values argument is nulljava.lang.IllegalArgumentException
- When count is out of range.public static <T> T single(java.lang.Iterable<T> values)
java.lang.NullPointerException
- When the values argument is nulljava.lang.IllegalArgumentException
- When count is out of range.public static <T> java.lang.Iterable<T> skip(java.lang.Iterable<T> values, int count)
java.lang.NullPointerException
- When the values argument is nulljava.lang.IllegalArgumentException
- When count is out of range.public static <T> T[] skip(T[] values, int count)
java.lang.NullPointerException
- When the values argument is nulljava.lang.IllegalArgumentException
- When count is out of range.public static <T> java.lang.Iterable<T> skipWhile(java.lang.Iterable<T> values, Predicates.Predicate1<? super T> predicate)
java.lang.NullPointerException
- When an argument is nullpublic static <T> T[] skipWhile(T[] values, Predicates.Predicate1<T> predicate)
java.lang.NullPointerException
- When an argument is nullpublic static <T extends java.lang.Comparable<T>> java.util.List<T> sort(java.util.List<T> values)
java.lang.NullPointerException
- When an argument is nullpublic static <T extends java.lang.Comparable<T>> java.util.List<T> sort(java.util.List<T> values, java.util.Comparator<? super T> comparator)
java.lang.NullPointerException
- When an argument is nullpublic static <T extends java.lang.Comparable<T>> java.util.List<T> sort(java.lang.Iterable<T> values)
java.lang.NullPointerException
- When an argument is nullpublic static <T extends java.lang.Comparable<T>> ReifiedList<T> sort(ReifiedIterable<T> values)
java.lang.NullPointerException
- When an argument is nullpublic static <T> java.util.List<T> sort(java.lang.Iterable<T> values, java.util.Comparator<? super T> comparator)
java.lang.NullPointerException
- When an argument is nullpublic static <T> java.util.List<T>[] split(java.lang.Iterable<? extends T> values, T delimiter)
java.lang.NullPointerException
- When an argument is null, or an item in the iterable is null.public static <T> java.util.List<T>[] split(T[] values, T delimiter)
java.lang.NullPointerException
- When an argument is null, or an item in the iterable is null.public static <T> java.util.List<T>[] split(java.lang.Iterable<T> values, T delimiter, java.util.Comparator<? super T> comparer)
java.lang.NullPointerException
- When an argument is null, or an item in the iterable is null and the comparer does not handle this case.public static <T> java.util.List<T>[] split(T[] values, T delimiter, java.util.Comparator<? super T> comparer)
java.lang.NullPointerException
- When an argument is null, or an item in the iterable is null and the comparer does not handle this case.public static <T> void swap(T[] array, int a, int b)
java.lang.NullPointerException
- Array is nulljava.lang.IndexOutOfBoundsException
- Array indices are out of range.public static <T> void swap(java.util.List<T> list, int a, int b)
java.lang.NullPointerException
- List is nulljava.lang.IndexOutOfBoundsException
- List indices are out of range.public static <T> void swap(T[] array, int[] a, int[] b)
java.lang.NullPointerException
- Array is nulljava.lang.IllegalArgumentException
- The length of index arrays are not equal.java.lang.IndexOutOfBoundsException
- An array index in the indices is out of rangepublic static <T> void swap(java.util.List<T> list, int[] a, int[] b)
java.lang.NullPointerException
- An argument is nulljava.lang.IllegalArgumentException
- The length of index arrays are not equal.java.lang.IndexOutOfBoundsException
- An array index in the indices is out of rangepublic static <T> java.lang.Iterable<T> take(java.lang.Iterable<T> values, int count)
java.lang.NullPointerException
- The values argument is null.public static <T> T[] take(T[] values, int count)
java.lang.NullPointerException
- The values argument is null.java.lang.IllegalArgumentException
- The count argument is out of range.public static <T> java.lang.Iterable<T> takeWhile(java.lang.Iterable<T> values, Predicates.Predicate1<? super T> predicate)
java.lang.NullPointerException
- An argument is null.public static <T> T[] takeWhile(T[] values, Predicates.Predicate1<? super T> predicate)
java.lang.NullPointerException
- An argument is null.public static <T> T[] toArray(java.util.Enumeration<T> enumeration, java.lang.Class<?> componentType)
java.lang.NullPointerException
- An argument is null.public static <T> T[] toArray(ReifiedList<T> list)
java.lang.NullPointerException
- An argument is null.public static <T> T[] toArray(ReifiedIterable<T> values)
java.lang.NullPointerException
- The values argument is null.public static <T> T[] toArray(java.lang.Iterable<T> values, java.lang.Class<?> componentType)
java.lang.NullPointerException
- An argument is nul.public static <T> T[] toArray(java.util.Collection<T> list, java.lang.Class<?> componentType)
java.lang.NullPointerException
- An argument is null.public static <T,TKey extends java.lang.Comparable<TKey>,TValue> AvlHashtable<TKey,TValue> toAvlHashtable(java.lang.Iterable<T> values, Functions.Function1<T,TKey> keySelector, Functions.Function1<T,TValue> valueSelector)
java.lang.NullPointerException
- When an argument is null.public static <T,TKey extends java.lang.Comparable<TKey>,TValue> AvlHashtable<TKey,TValue> toAvlHashtable(T[] values, Functions.Function1<T,TKey> keySelector, Functions.Function1<T,TValue> valueSelector)
java.lang.NullPointerException
- When an argument is null.public static <T> java.util.List<T> toList(java.util.Enumeration<? extends T> enumeration)
java.lang.NullPointerException
- An argument is null.public static <T> ReifiedList<T> toList(java.util.Enumeration<T> enumeration, java.lang.Class<?> genericTypeParameter)
java.lang.NullPointerException
- An argument is null.public static <T> java.util.List<T> toList(java.lang.Iterable<? extends T> values)
java.lang.NullPointerException
- The values argument is null.public static <T> ReifiedList<T> toList(java.lang.Iterable<T> values, java.lang.Class<?> genericTypeParameter)
java.lang.NullPointerException
- The values argument is null.public static <T> ReifiedList<T> toList(ReifiedIterable<T> values)
java.lang.NullPointerException
- The values argument is null.public static <T> ReifiedList<T> toList(T[] values)
java.lang.NullPointerException
- The values argument is null.public static <T> java.lang.String toString(java.lang.Iterable<T> iterable)
public static <T> java.lang.String toString(T[] iterable)
public static <T> java.lang.Iterable<T> union(java.lang.Iterable<T> first, java.lang.Iterable<T> second)
java.lang.NullPointerException
- When an argument is null.public static <T> java.lang.Iterable<T> union(java.lang.Iterable<T> first, java.lang.Iterable<T> second, java.util.Comparator<? super T> comparer)
java.lang.NullPointerException
- When the first or second argument is null.public static <T> T[] union(T[] first, T[] second)
java.lang.NullPointerException
- When an argument is null.public static <T> T[] union(T[] first, T[] second, java.util.Comparator<? super T> comparer)
java.lang.NullPointerException
- When the first or second argument is null.public static <T,TResult1,TResult2> java.lang.Iterable<Pair<TResult1,TResult2>> unzip(java.lang.Iterable<T> values, Functions.Function1<? super T,Pair<TResult1,TResult2>> func)
java.lang.NullPointerException
- When an argument is nullpublic static <T,TResult1,TResult2> Pair<TResult1,TResult2>[] unzip(T[] values, Functions.Function1<T,Pair<TResult1,TResult2>> func)
java.lang.NullPointerException
- When an argument is nullpublic static <T> java.lang.Iterable<T> where(java.lang.Iterable<T> values, Predicates.Predicate1<? super T> predicate)
java.lang.NullPointerException
- When an argument is nullpublic static <T> T[] where(T[] values, Predicates.Predicate1<? super T> predicate)
java.lang.NullPointerException
- When an argument is nullpublic static <TFirst,TSecond,TResult> java.lang.Iterable<TResult> zip(java.lang.Iterable<TFirst> first, java.lang.Iterable<TSecond> second, Functions.Function2<TFirst,TSecond,TResult> function)
java.lang.NullPointerException
- When an argument is null.public static <TFirst,TSecond,TResult> TResult[] zip(TFirst[] first, TSecond[] second, Functions.Function2<TFirst,TSecond,TResult> function)
java.lang.NullPointerException
- When an argument is null.