org.gnome.gtk

## Class TreeIter

- Object
- - org.freedesktop.bindings.Pointer
  - - org.gnome.glib.Boxed
    - - org.gnome.gtk.TreeIter

-     public final class TreeIter
      extends Boxed

  A temporary pointer to a row in a TreeModel. TreeIters are used to indicate a row in a TreeModel, either the "current" row if you are iterating over the data, or as an indication of which row a given event occurred on.

  To obtain a new TreeIter, use one of the following:

  - ListStore's `appendRow()` (to add a new record to the end of the data set in the model);
  - TreeModel's `getIterFirst()` (to start iterating through the rows in the model); or
  - TreeSelection's `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.

  Since:
    4.0.5
  Author:
    Andrew Cowie, Srichand Pendyala, Vreixo Formoso

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `TreeIter` | `copy()` Create a copy of this TreeIter.
    `boolean` | `iterNext()` Change this TreeIter to point to the row following the current one.

    - ### Methods inherited from class org.freedesktop.bindings.Pointer

      `toString`

    - ### Methods inherited from class Object

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Method Detail

    - #### copy

          public TreeIter copy()

      Create a copy of this TreeIter.
      Since:
        4.0.14

    - #### iterNext

          public boolean iterNext()

      Change this TreeIter to point to the row following the current one. In a ListStore, this is simply the next row in the model, and what you use in conjunction with `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.

      Since:
        4.0.5