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 / sun / misc / SoftCache$1.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.3 KB  |  49 lines

  1. package sun.misc;
  2.  
  3. import java.lang.ref.SoftReference;
  4. import java.util.Iterator;
  5. import java.util.Map;
  6. import java.util.NoSuchElementException;
  7. import sun.misc.SoftCache.EntrySet;
  8.  
  9. class SoftCache$1 implements Iterator {
  10.    Iterator hashIterator;
  11.    SoftCache.Entry next;
  12.    // $FF: synthetic field
  13.    private final SoftCache.EntrySet this$1;
  14.  
  15.    SoftCache$1(SoftCache.EntrySet var1) {
  16.       this.this$1 = var1;
  17.       this.hashIterator = this.this$1.hashEntries.iterator();
  18.       this.next = null;
  19.    }
  20.  
  21.    public boolean hasNext() {
  22.       while(this.hashIterator.hasNext()) {
  23.          Map.Entry var1 = (Map.Entry)this.hashIterator.next();
  24.          SoftCache.ValueCell var2 = (SoftCache.ValueCell)var1.getValue();
  25.          Object var3 = null;
  26.          if (var2 == null || (var3 = ((SoftReference)var2).get()) != null) {
  27.             this.next = new SoftCache.Entry(EntrySet.access$800(this.this$1), var1, var3);
  28.             return true;
  29.          }
  30.       }
  31.  
  32.       return false;
  33.    }
  34.  
  35.    public Object next() {
  36.       if (this.next == null && !this.hasNext()) {
  37.          throw new NoSuchElementException();
  38.       } else {
  39.          SoftCache.Entry var1 = this.next;
  40.          this.next = null;
  41.          return var1;
  42.       }
  43.    }
  44.  
  45.    public void remove() {
  46.       this.hashIterator.remove();
  47.    }
  48. }
  49.