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 / AbstractList$ListItr.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.4 KB  |  64 lines

  1. package java.util;
  2.  
  3. class AbstractList$ListItr extends AbstractList.Itr implements ListIterator {
  4.    // $FF: synthetic field
  5.    private final AbstractList this$0;
  6.  
  7.    AbstractList$ListItr(AbstractList var1, int var2) {
  8.       super(var1, (AbstractList.1)null);
  9.       this.this$0 = var1;
  10.       super.cursor = var2;
  11.    }
  12.  
  13.    public boolean hasPrevious() {
  14.       return super.cursor != 0;
  15.    }
  16.  
  17.    public Object previous() {
  18.       try {
  19.          Object var1 = this.this$0.get(--super.cursor);
  20.          ((AbstractList.Itr)this).checkForComodification();
  21.          super.lastRet = super.cursor;
  22.          return var1;
  23.       } catch (IndexOutOfBoundsException var2) {
  24.          ((AbstractList.Itr)this).checkForComodification();
  25.          throw new NoSuchElementException();
  26.       }
  27.    }
  28.  
  29.    public int nextIndex() {
  30.       return super.cursor;
  31.    }
  32.  
  33.    public int previousIndex() {
  34.       return super.cursor - 1;
  35.    }
  36.  
  37.    public void set(Object var1) {
  38.       if (super.lastRet == -1) {
  39.          throw new IllegalStateException();
  40.       } else {
  41.          ((AbstractList.Itr)this).checkForComodification();
  42.  
  43.          try {
  44.             this.this$0.set(super.lastRet, var1);
  45.             super.expectedModCount = this.this$0.modCount;
  46.          } catch (IndexOutOfBoundsException var3) {
  47.             throw new ConcurrentModificationException();
  48.          }
  49.       }
  50.    }
  51.  
  52.    public void add(Object var1) {
  53.       ((AbstractList.Itr)this).checkForComodification();
  54.  
  55.       try {
  56.          this.this$0.add(super.cursor++, var1);
  57.          super.lastRet = -1;
  58.          super.expectedModCount = this.this$0.modCount;
  59.       } catch (IndexOutOfBoundsException var3) {
  60.          throw new ConcurrentModificationException();
  61.       }
  62.    }
  63. }
  64.