public class Iterables
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
Iterables.RevIterable<T>
Reverse iterable implementation.
|
Constructor and Description |
---|
Iterables() |
Modifier and Type | Method and Description |
---|---|
static <T> java.lang.Iterable<T> |
directFrom(java.util.List<T> list,
T elem)
Return iterable which traverses list in direct order starting from given
element.
|
static <T> java.lang.Iterable<T> |
reverse(java.util.List<T> list)
Static factory method which returns reverse iterable for a given list.
|
static <T> java.lang.Iterable<T> |
reverseFrom(java.util.List<T> list,
T elem)
Create new reverse iterable which will traverse list starting from
given element.
|
public static <T> java.lang.Iterable<T> reverse(java.util.List<T> list)
T
- List item type.list
- List.Iterable
which performs iteration through
elements in reverse order.public static <T> java.lang.Iterable<T> reverseFrom(java.util.List<T> list, T elem)
T
- List item type.list
- List.elem
- Initial element from which iteration will be started.
Note that the element itself will not be returned.Iterable
which performs iteration through
elements in reverse order.public static <T> java.lang.Iterable<T> directFrom(java.util.List<T> list, T elem)
T
- List item type.list
- List.elem
- Initial element from which iteration will be started.
Note that the element itself will not be returned.Iterable
which performs iteration through
elements in direct order.