home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &… the Search for Life CD 3 / 0_CD-ROM.iso / install / jre1_3 / lib / rt.jar / javax / swing / tree / DefaultMutableTreeNode$PostorderEnumeration.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  978 b   |  38 lines

  1. package javax.swing.tree;
  2.  
  3. import java.util.Enumeration;
  4.  
  5. final class DefaultMutableTreeNode$PostorderEnumeration implements Enumeration {
  6.    protected TreeNode root;
  7.    protected Enumeration children;
  8.    protected Enumeration subtree;
  9.    // $FF: synthetic field
  10.    private final DefaultMutableTreeNode this$0;
  11.  
  12.    public DefaultMutableTreeNode$PostorderEnumeration(DefaultMutableTreeNode var1, TreeNode var2) {
  13.       this.this$0 = var1;
  14.       this.root = var2;
  15.       this.children = this.root.children();
  16.       this.subtree = DefaultMutableTreeNode.EMPTY_ENUMERATION;
  17.    }
  18.  
  19.    public boolean hasMoreElements() {
  20.       return this.root != null;
  21.    }
  22.  
  23.    public Object nextElement() {
  24.       Object var1;
  25.       if (this.subtree.hasMoreElements()) {
  26.          var1 = this.subtree.nextElement();
  27.       } else if (this.children.hasMoreElements()) {
  28.          this.subtree = new DefaultMutableTreeNode$PostorderEnumeration(this.this$0, (TreeNode)this.children.nextElement());
  29.          var1 = this.subtree.nextElement();
  30.       } else {
  31.          var1 = this.root;
  32.          this.root = null;
  33.       }
  34.  
  35.       return var1;
  36.    }
  37. }
  38.