public final class TreeIter extends Boxed
To obtain a new TreeIter, use one of the following:
appendRow()
(to add a new
record to the end of the data set in the model);
getIterFirst()
(to start
iterating through the rows in the model); or
getSelected()
(allowing you to identify the selected row and subsequently read data from
it, usually with TreeModel's
getValue()
.
Like other iterators in Java, a TreeIter becomes invalid the moment the
underlying model changes. If you need a persistent pointer to a particular
row, create a TreeRowReference
.
Note that although one use case for TreeIter is to iterate through all
the rows in a model, more often they are used to point to a single row (the
one you are presently adding data to, or the one that was selected by the
user); these aren't java.util.Iterator
s.
public TreeIter copy()
public boolean iterNext()
getIterFirst()
to
iterate through the entire model. In a TreeStore, however, it will
return the next row at this level.
This will return true
if it was able to change this
TreeIter to the next row.
Be aware that when this returns false
the TreeIter is no
longer valid.