home *** CD-ROM | disk | FTP | other *** search
/ S283 Planetary Science &n…he Search for Life DVD 2 / DVD-ROM.iso / install / jre1_3 / lib / rt.jar / java / util / TreeMap$Iterator.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.5 KB  |  59 lines

  1. package java.util;
  2.  
  3. class TreeMap$Iterator implements Iterator {
  4.    private int type;
  5.    private int expectedModCount;
  6.    private TreeMap.Entry lastReturned;
  7.    private TreeMap.Entry next;
  8.    private TreeMap.Entry firstExcluded;
  9.    // $FF: synthetic field
  10.    private final TreeMap this$0;
  11.  
  12.    TreeMap$Iterator(TreeMap var1, int var2) {
  13.       this.this$0 = var1;
  14.       this.expectedModCount = TreeMap.access$1400(this.this$0);
  15.       this.lastReturned = null;
  16.       this.firstExcluded = null;
  17.       this.type = var2;
  18.       this.next = TreeMap.access$100(var1);
  19.    }
  20.  
  21.    TreeMap$Iterator(TreeMap var1, TreeMap.Entry var2, TreeMap.Entry var3) {
  22.       this.this$0 = var1;
  23.       this.expectedModCount = TreeMap.access$1400(this.this$0);
  24.       this.lastReturned = null;
  25.       this.firstExcluded = null;
  26.       this.type = 2;
  27.       this.next = var2;
  28.       this.firstExcluded = var3;
  29.    }
  30.  
  31.    public boolean hasNext() {
  32.       return this.next != this.firstExcluded;
  33.    }
  34.  
  35.    public Object next() {
  36.       if (this.next == this.firstExcluded) {
  37.          throw new NoSuchElementException();
  38.       } else if (TreeMap.access$1400(this.this$0) != this.expectedModCount) {
  39.          throw new ConcurrentModificationException();
  40.       } else {
  41.          this.lastReturned = this.next;
  42.          this.next = TreeMap.access$200(this.this$0, this.next);
  43.          return this.type == 0 ? this.lastReturned.key : (this.type == 1 ? this.lastReturned.value : this.lastReturned);
  44.       }
  45.    }
  46.  
  47.    public void remove() {
  48.       if (this.lastReturned == null) {
  49.          throw new IllegalStateException();
  50.       } else if (TreeMap.access$1400(this.this$0) != this.expectedModCount) {
  51.          throw new ConcurrentModificationException();
  52.       } else {
  53.          TreeMap.access$400(this.this$0, this.lastReturned);
  54.          ++this.expectedModCount;
  55.          this.lastReturned = null;
  56.       }
  57.    }
  58. }
  59.