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$BreadthFirstEnumeration$Queue.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.4 KB  |  54 lines

  1. package javax.swing.tree;
  2.  
  3. import java.util.NoSuchElementException;
  4.  
  5. final class DefaultMutableTreeNode$BreadthFirstEnumeration$Queue {
  6.    DefaultMutableTreeNode.BreadthFirstEnumeration.Queue.QNode head;
  7.    DefaultMutableTreeNode.BreadthFirstEnumeration.Queue.QNode tail;
  8.    // $FF: synthetic field
  9.    private final DefaultMutableTreeNode.BreadthFirstEnumeration this$1;
  10.  
  11.    DefaultMutableTreeNode$BreadthFirstEnumeration$Queue(DefaultMutableTreeNode.BreadthFirstEnumeration var1) {
  12.       this.this$1 = var1;
  13.    }
  14.  
  15.    public void enqueue(Object var1) {
  16.       if (this.head == null) {
  17.          this.head = this.tail = new DefaultMutableTreeNode.BreadthFirstEnumeration.Queue.QNode(this, var1, (DefaultMutableTreeNode.BreadthFirstEnumeration.Queue.QNode)null);
  18.       } else {
  19.          this.tail.next = new DefaultMutableTreeNode.BreadthFirstEnumeration.Queue.QNode(this, var1, (DefaultMutableTreeNode.BreadthFirstEnumeration.Queue.QNode)null);
  20.          this.tail = this.tail.next;
  21.       }
  22.  
  23.    }
  24.  
  25.    public Object dequeue() {
  26.       if (this.head == null) {
  27.          throw new NoSuchElementException("No more elements");
  28.       } else {
  29.          Object var1 = this.head.object;
  30.          DefaultMutableTreeNode.BreadthFirstEnumeration.Queue.QNode var2 = this.head;
  31.          this.head = this.head.next;
  32.          if (this.head == null) {
  33.             this.tail = null;
  34.          } else {
  35.             var2.next = null;
  36.          }
  37.  
  38.          return var1;
  39.       }
  40.    }
  41.  
  42.    public Object firstObject() {
  43.       if (this.head == null) {
  44.          throw new NoSuchElementException("No more elements");
  45.       } else {
  46.          return this.head.object;
  47.       }
  48.    }
  49.  
  50.    public boolean isEmpty() {
  51.       return this.head == null;
  52.    }
  53. }
  54.