public class EmptyBidiIterable<T> extends java.lang.Object implements BidiIterable<T>
| Constructor and Description |
|---|
EmptyBidiIterable() |
| Modifier and Type | Method and Description |
|---|---|
static <T> EmptyBidiIterable<T> |
instance() |
BidiIterator<T> |
iterator()
Returns an iterator that can be used forwards and backwards.
|
BidiIterable<T> |
reverse()
Returns a reverse version of this iterable that can be used
forwards and backwards.
|
public static <T> EmptyBidiIterable<T> instance()
public BidiIterator<T> iterator()
BidiIterableiterator in interface java.lang.Iterable<T>iterator in interface BidiIterable<T>null.public BidiIterable<T> reverse()
BidiIterableReturns a reverse version of this iterable that can be used
forwards and backwards. In other words, an iterator provided by
the reverse iterable will delegate its hasNext()
and next() invocations to
BidiIterator.hasPrevious() and BidiIterator.previous()
respectively.
This allows clients to iterate backwards by means of the enhanced for-loop:
for(T t: iterable.reverse()) {
// do something with t
}
reverse in interface BidiIterable<T>null.