iterables.
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static boolean | |
| public static <T> Iterable | |
| public static <T> Iterable | Returns: the remaining elements after droppingthe elements from which to drop. May not be iterable, final Functions.null.the predicate which decides whether to keep dropping elements. May not be predicatenull.Returns an Iterable containing all elements starting from the first element for which the drop-predicate returned false. |
| public static boolean | Returns: true if the two iterables contain equal elements in the same order.an iterable. May not be iterable, Iterable<?> null.an iterable. May not be other)null.Determines whether two iterables contain equal elements in the same order. |
| public static <T> boolean | |
| public static <T> Iterable | Returns: an iterable that contains only the elements that fulfill the predicate. Nevernull.the unfiltered iterable. May not be unfiltered, Functions.null.the predicate. May not be predicatenull.Returns the elements of |
| public static <T> Iterable | |
| public static <T> Iterable | Returns: an unmodifiable iterable containing all elements of the original iterable without anynull references. Never null.the unfiltered iterable. May not be unfiltered)null.Returns a new iterable filtering any null references. |
| public static <T> T | Returns: the first element in the iterable for which the given predicate returnstrue, returns
null if no element matches the predicate or the iterable is empty.the iterable. May not be iterable, Functions.null.the predicate. May not be predicatenull.Finds the first element in the given iterable that fulfills the predicate. |
| public static <T> T | Returns: the last element in the iterable for which the given predicate returnstrue, returns
null if no element matches the predicate or the iterable is empty.the iterable. May not be iterable, Functions.null.the predicate. May not be predicatenull.Finds the last element in the given iterable that fulfills the predicate. |
| public static <T, R> Iterable | Returns: an iterable that provides the result of the transformation. Nevernull.the original iterable. May not be original, Functions.null.the transformation. May not be transformationnull and must not yield null.Returns an iterable that performs the given |
| public static <T> Iterable | |
| public static <T, R> R | Returns: the last result of the applied combinator function orseed for the empty input.the to-be-folded iterable. May not be iterable, R null.the initial value. May be seed, Functions.null.the combinator function. May not be functionnull.
Applies the combinator |
| public static <T> boolean | Returns: true if every element in iterable satisfies the predicate and also if there is no element.the iterable. May not be iterable, Functions.null.the predicate. May not be predicatenull.Returns |
| public static <T> void | forEach(Iterable<T>
the iterable. May not be iterable, Procedures.null.the procedure. May not be procedurenull.Applies |
| public static <T> void | forEach(Iterable<T>
the iterable. May not be iterable, Procedures.null.the procedure. May not be procedurenull.Applies |
| public static <K, V> Map | Returns: a map mapping the result of evaluating the functionkeyFunction on each value in the input
iterable to that value. As there can be more than one value mapped by a key, the mapping result is is a
list of values.the values to use when constructing the values, Functions.Map. May not be null.the function used to produce the key for each value. May not be computeKeysnull.Returns a map for which the |
| public static <T> T | |
| public static <A> Iterable | |
| public static boolean | |
| public static boolean | Returns: true if the iterable is null or contains no elementsthe to-be-queried iterable. May be iterable)null.Determines if the given iterable is |
| public static String | |
| public static String | Returns: the string representation of the iterable's elements. Nevernull.the iterable. May not be iterable, CharSequence null.the separator. May not be separator)null.Returns the concatenated string representation of the elements in the given iterable. |
| public static <T> String | Returns: the string representation of the iterable's elements. Nevernull.the iterable. May not be iterable, CharSequence null.the separator. May not be separator, Functions.null.the function that is used to compute the string representation of a single element. May not be
functionnull.Returns the concatenated string representation of the elements in the given iterable. |
| public static <T> String | Returns: the string representation of the iterable's elements. Nevernull.the iterable. May not be iterable, CharSequence null.prepends the resulting string if the iterable contains at least one element. May be before, CharSequence null which is equivalent to passing an empty string.the separator. May be separator, CharSequence null which is equivalent to passing an empty string.appended to the resulting string if the iterable contain at least one element. May be after, Functions.null which is equivalent to passing an empty string.the function that is used to compute the string representation of a single element. May not be
functionnull.Returns the concatenated string representation of the elements in the given iterable. |
| public static <T> T | Returns: the last element in the iterable ornull.the iterable. May not be iterable)null.
Deprecated
Use
lastOrNull(Iterable<T>) instead: in Java 21, the
method getLast has been introduced to some collection classes and would
be preferred to this one by the Xbase/Xtend compiler, breaking the
semantics of the original code:
The Java 21 getLast method throws a NoSuchElementException when the
collection is empty, instead of returning null.
Returns the last element in the given iterable or |
| public static <T> T | Returns: the last element in the iterable ornull.the iterable. May not be iterable)null.Returns the last element in the given iterable or |
| public static <T, R> Iterable | Returns: an iterable that provides the result of the transformation. Nevernull.the original iterable. May not be original, Functions.null.the transformation. May not be transformationnull.Returns an iterable that performs the given |
| public static <T extends Comparable | |
| public static <T> T | Returns: the maximumthe elements to find the maximum of. May not be iterable, Comparator<? super T> null.the comparison function. May not be comparator)null.Finds the maximum element according to |
| public static <T, C extends Comparable | Returns: the maximumthe elements to find the maximum of. May not be iterable, final Functions.null.a function that returns a comparable characteristic to compare the elements by. May not be compareBynull.Finds the element that yields the maximum value when passed to |
| public static <T extends Comparable | |
| public static <T> T | Returns: the minimumthe elements to find the minimum of. May not be iterable, Comparator<? super T> null.the comparison function. May not be comparator)null.Finds the mininmum element according to |
| public static <T, C extends Comparable | Returns: the minimumthe elements to find the minimum of. May not be iterable, final Functions.null.a function that returns a comparable characteristic to compare the elements by. May not be compareBynull.Finds the element that yields the minimum value when passed to |
| public static <T> Iterable | Returns: a combined iterable. Nevernull.the first iterable. May not be a, Iterable<? extends T> null.the second iterable. May not be b)null.Concatenates two iterables into a single iterable. |
| public static <T> T | Returns: the last result of the applied combinator function ornull for the empty input.the to-be-reduced iterable. May not be iterable, Functions.null.the combinator function. May not be functionnull.
Applies the combinator |
| public static <T> Iterable | Returns: an iterable that contains only the elements that do not fulfill the predicate. Nevernull.the unfiltered iterable. May not be unfiltered, Functions.null.the predicate. May not be predicatenull.Returns the elements of |
| public static <T> Iterable | Returns: an iterable that contains only the elements that are not instances oftype. Never null.
Note that the elements of the iterable can be null as null is an instance of nothing.the unfiltered iterable. May not be unfiltered, Class<?> null.the type of elements undesired. May not be type)null.Returns the elements of |
| public static int | |
| public static <T extends Comparable | |
| public static <T> List | Returns: a sorted list as a shallow copy of the given iterable.the items to be sorted. May not be iterable, Comparator<? super T> null.the comparator to be used. May be comparator)null to indicate that the natural ordering of the
elements should be used.
Deprecated
Use
sortWith(Iterable, Comparator) instead.
This method is deprecated in favor of |
| public static <T, C extends Comparable | |
| public static <T> List | Returns: a sorted list as a shallow copy of the given iterable.the items to be sorted. May not be iterable, Comparator<? super T> null.the comparator to be used. May be comparator)null to indicate that the natural ordering of the
elements should be used.Creates a sorted list that contains the items of the given iterable. |
| public static <T> Iterable | |
| public static <T> Iterable | |
| public static <T> Iterable | Returns: the taken elementsthe elements from which to take. May not be iterable, final Functions.null.the predicate which decides whether to keep taking elements. May not be predicatenull.Returns an Iterable containing all elements starting from the head of the source up to and excluding the first element that violates the predicate The resulting Iterable is a lazily computed view, so any modifications to the underlying Iterables will be reflected on subsequent iterations. |
| public static <K, V> Map | Returns: a map mapping each entry in the given iterable to the corresponding result when evaluating the functioncomputeValues.the keys to use when constructing the keys, Functions.Map. May not be null.the function used to produce the values for each key. May not be computeValuesnull.Returns a map for which the |
| public static <T> List | Returns: a list with the same entries as the given iterable. May be the same as the given iterable iff it implementsList, otherwise a copy is returned. Never null.the iterable. May not be iterable)null.Returns a list that contains all the entries of the given iterable in the same order. |
| public static <K, V> Map | Returns: a map mapping the result of evaluating the functionkeyFunction on each value in the input
collection to that valuethe values to use when constructing the values, Functions.Map. May not be null.the function used to produce the key for each value. May not be computeKeysnull.Returns a map for which the |
| public static <T, K, V> Map | Returns: a map mapping the result of evaluating the functionskeyFunction and computeValues on each value in the input
iterator to that valuethe elements to use when constructing the inputs, Functions.Map. May not be null.the function used to produce the key for each value. May not be computeKeys,null.the function used to produce the values for each key. May not be computeValuesnull.Returns a map for which the |
| public static <T> Set | Returns: a set with the unique entries of the given iterable. May be the same as the given iterable iff it implementsSet, otherwise a copy is returned. Never null.the iterable. May not be iterable)null.Returns a set that contains all the unique entries of the given iterable in the order of their appearance. |