|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.mmbase.bridge.util.TreeList.TreeItr
The TreeIterator!
| Method Summary | |
void |
add(java.lang.Object o)
|
int |
currentDepth()
Depth of the last node fetched with next() or nextNode() |
protected Node |
getNextNode()
Implementation idea graphicly. |
protected Node |
getRealNode(int index)
|
boolean |
hasNext()
|
boolean |
hasPrevious()
|
java.lang.Object |
next()
|
int |
nextIndex()
|
Node |
nextNode()
Returns the next element in the iterator as a Node |
protected boolean |
prepare(int index)
Makes sure that query with given index has an iterator, a 'next' node and a 'previous' node. |
java.lang.Object |
previous()
|
int |
previousIndex()
|
Node |
previousNode()
Returns the previous element in the iterator as a Node |
void |
remove()
|
void |
set(java.lang.Object o)
|
protected void |
useNext(int index)
Uses the new 'next' node of the iterator with the given index. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
public boolean hasNext()
hasNext in interface java.util.ListIteratorprotected final boolean prepare(int index)
protected final void useNext(int index)
protected final Node getRealNode(int index)
public Node nextNode()
NodeIterator
nextNode in interface NodeIteratorpublic int currentDepth()
currentDepth in interface TreeIteratorpublic java.lang.Object next()
next in interface java.util.ListIteratorprotected final Node getNextNode()
iterators
current-2 current-1 current current+1 [///]: used node
[///] [///] [///] [///] [|||]: last used node (lastNode)
[ ]: unused node
... [///] [///] [|||] _ [///] previousNodes [ * ]: considerd next node (nextListNextNode)
\
[ ] [ ] [ ] `---> [ * ] nextNodes
if (! [|||] contained by [ * ]) current--
Everytime next is called, the last used node is compared with the next node of the
next iterator (the arrow int the above scheme). If the last used node is 'contained' by
this next node, then this next node of the next iterator will be 'next()' otherwise current
is decreased by one and next is called recursively. This means that the next node is always
one longer then the current one, equally long, or shorter.
public boolean hasPrevious()
hasPrevious in interface java.util.ListIteratorpublic Node previousNode()
NodeIterator
previousNode in interface NodeIteratorpublic java.lang.Object previous()
previous in interface java.util.ListIteratorpublic int nextIndex()
nextIndex in interface java.util.ListIteratorpublic int previousIndex()
previousIndex in interface java.util.ListIteratorpublic void remove()
remove in interface java.util.ListIteratorpublic void set(java.lang.Object o)
set in interface java.util.ListIteratorpublic void add(java.lang.Object o)
add in interface java.util.ListIterator
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||