public class BasicNodeIterable extends Object implements BidiIterable<AbstractNode>
| Modifier | Constructor and Description |
|---|---|
protected |
BasicNodeIterable(AbstractNode startWith) |
| Modifier and Type | Method and Description |
|---|---|
BidiIterator<AbstractNode> |
iterator()
Returns an iterator that can be used forwards and backwards.
|
BidiIterable<AbstractNode> |
reverse()
Returns a reverse version of this iterable that can be used
forwards and backwards.
|
protected BasicNodeIterable(AbstractNode startWith)
public BidiIterator<AbstractNode> iterator()
BidiIterableiterator in interface Iterable<AbstractNode>iterator in interface BidiIterable<AbstractNode>null.public BidiIterable<AbstractNode> 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<AbstractNode>null.Copyright © 2015. All Rights Reserved.