|
Extension SDK | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
This interface specifies the TreeIterator.
The implementation names for this interface have the name TreeIteratorXXXX
where the XXXX letters represent the order of the returned nodes and each
X is A, B, C or D.
If you consider a tree with the form, and the returned order is
A, B, C and D, the iterator will be called TreeIteratorABCD.
A
/ \
B C
/
D
Example:
DefaultMutableTreeNode a = new DefaultMutableTreeNode("A");
DefaultMutableTreeNode b = new DefaultMutableTreeNode("B");
DefaultMutableTreeNode c = new DefaultMutableTreeNode("C");
DefaultMutableTreeNode d = new DefaultMutableTreeNode("D");
a.add(b);
a.add(c);
b.add(d);
TreeIterator i = new TreeIteratorABDC(a);
while(i.hasNext())
System.err.println(i.nextNode());
The output will be
A
B
D
C
Note: Not all the possible TreeIterators are implemented yet. If
you need one, ...
| Method Summary | |
boolean |
hasNext()
|
java.lang.Object |
next()
|
javax.swing.tree.TreeNode |
nextNode()
same as next but returns the TreeNode |
void |
remove()
|
| Method Detail |
public boolean hasNext()
hasNext in interface java.util.Iteratorpublic java.lang.Object next()
next in interface java.util.Iteratorpublic void remove()
remove in interface java.util.Iteratorpublic javax.swing.tree.TreeNode nextNode()
|
Extension SDK | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright ©1997, 2003, Oracle. All rights reserved.