TreeIterator (JEvolution)
Date: 2013-03-21

evSOLve.JEvolution.misc

## Class TreeIterator

- java.lang.Object
- - evSOLve.JEvolution.misc.TreeIterator

- All Implemented Interfaces:
    java.util.Iterator<javax.swing.tree.TreeNode>

      public class TreeIterator
      extends java.lang.Object
      implements java.util.Iterator<javax.swing.tree.TreeNode>

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TreeIterator(javax.swing.tree.TreeModel treeModel)` Constructs the TreeIterator.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `hasNext()` Returns, if there are more nodes in the tree.
    `javax.swing.tree.TreeNode` | `next()` Returns the next tree node.
    `void` | `remove()` Removes the last returned tree node from this iterator.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TreeIterator

          public TreeIterator(javax.swing.tree.TreeModel treeModel)

      Constructs the TreeIterator.
      Parameters:
        `treeModel` - the TreeModel

  - ### Method Detail

    - #### hasNext

          public boolean hasNext()

      Returns, if there are more nodes in the tree. Actually, here the next node is determined. If the current node is a leaf, we have to go up, otherwise we always go down (depth first traversal).
      Specified by:
        `hasNext` in interface `java.util.Iterator<javax.swing.tree.TreeNode>`
      Returns:
        true, if there is a next node

    - #### next

          public javax.swing.tree.TreeNode next()

      Returns the next tree node.
      Specified by:
        `next` in interface `java.util.Iterator<javax.swing.tree.TreeNode>`
      Returns:
        the next tree node

    - #### remove

          public void remove()

      Removes the last returned tree node from this iterator. Note that the node is NOT removed from its tree, so no pointers in the node are changed. The consequence of this method call is that this iterator is not descending into the subtree defined by the last returned node, but is treating the node as leaf node.
      Specified by:
        `remove` in interface `java.util.Iterator<javax.swing.tree.TreeNode>`