|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BidiIterable<T>
An iterable that is capable of being iterated in both directions - forwards and backwards.
Method Summary | |
---|---|
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. |
Method Detail |
---|
BidiIterator<T> iterator()
iterator
in interface java.lang.Iterable<T>
null
.BidiIterable<T> reverse()
Returns 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 }
null
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |