|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface BidiTreeIterable<E>
An iterable over a tree structure that is capable of being iterated
in both directions - forwards and backwards. The tree iterator
returned by iterator()
is capable to prune some parts of the tree
if clients are not interested in descending into them.
Method Summary | |
---|---|
BidiTreeIterator<E> |
iterator()
Returns a tree iterator that can be used forwards and backwards. |
BidiTreeIterable<E> |
reverse()
Returns a reverse version of this iterable that can be used forwards and backwards. |
Method Detail |
---|
BidiTreeIterator<E> iterator()
iterator
in interface BidiIterable<E>
iterator
in interface java.lang.Iterable<E>
null
.BidiTreeIterable<E> 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 }
reverse
in interface BidiIterable<E>
null
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |