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 / WeakHashMap$1.class (.txt) < prev    next >
Encoding:
Java Class File  |  1979-12-31  |  1.2 KB  |  45 lines

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