|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.metamatrix.common.tree.TreeNodeIteratorWithStack
public class TreeNodeIteratorWithStack
This iterator implementation extends TreeNodeIterator by maintaining
a stack of TreeNodes from the root to the last node returned by next().
This class has the ability to track with each TreeNode instance in the stack a payload object. However,
in order to use this feature, this class must be extended by subclassing the createPayload(TreeNode)
method must be overridden.
Also, the stack is accessed with the getStack() method and contains
instances of TreeNodeIteratorWithStack.StackEntry instances.
| Nested Class Summary | |
|---|---|
static class |
TreeNodeIteratorWithStack.StackEntry
|
| Constructor Summary | |
|---|---|
TreeNodeIteratorWithStack(TreeNode startingNode,
TreeView view)
Construct an instance of XMLNamespaceAwareIterator. |
|
TreeNodeIteratorWithStack(TreeNode startingNode,
TreeView view,
java.util.Iterator iter)
Construct an instance that wraps the supplied iterator. |
|
| Method Summary | |
|---|---|
protected java.lang.Object |
createPayload(TreeNode node)
|
java.util.LinkedList |
getStack()
Return the list of StackEntry objects that each have
a target and a payload. |
TreeView |
getTreeView()
|
boolean |
hasNext()
|
protected boolean |
isStartingNode(TreeNode node)
|
java.lang.Object |
next()
|
protected void |
process(java.lang.Object object)
|
void |
remove()
|
protected void |
synchronizeStack(TreeNode obj)
|
java.lang.String |
toString()
|
protected java.lang.String |
toStringPayload(java.lang.Object obj)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TreeNodeIteratorWithStack(TreeNode startingNode,
TreeView view)
startingNode - view -
public TreeNodeIteratorWithStack(TreeNode startingNode,
TreeView view,
java.util.Iterator iter)
startingNode - view - iter - the iterator that provides the set of TreeNodes over which the iteration is to occur.| Method Detail |
|---|
public boolean hasNext()
hasNext in interface java.util.Iteratorpublic void remove()
remove in interface java.util.Iteratorpublic java.lang.Object next()
next in interface java.util.Iteratorprotected void process(java.lang.Object object)
protected void synchronizeStack(TreeNode obj)
entity - protected boolean isStartingNode(TreeNode node)
node -
protected java.lang.Object createPayload(TreeNode node)
public java.util.LinkedList getStack()
StackEntry objects that each have
a target and a payload.
public TreeView getTreeView()
public java.lang.String toString()
toString in class java.lang.Objectprotected java.lang.String toStringPayload(java.lang.Object obj)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||