home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 June / CHIPHEFT062001.ISO / browser / nc32lyc / comm.z / java40.jar / netscape / softupdate / RegKeyEnumerator.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-08-15  |  1.0 KB  |  40 lines

  1. package netscape.softupdate;
  2.  
  3. import java.util.Enumeration;
  4. import java.util.NoSuchElementException;
  5. import netscape.security.PrivilegeManager;
  6.  
  7. final class RegKeyEnumerator implements Enumeration {
  8.    private String path = "";
  9.    private Registry reg;
  10.    private int key;
  11.    private int state;
  12.    private int style;
  13.    private String target;
  14.  
  15.    RegKeyEnumerator(Registry var1, int var2, int var3, String var4) {
  16.       this.reg = var1;
  17.       this.key = var2;
  18.       this.style = var3;
  19.       this.target = var4;
  20.    }
  21.  
  22.    public boolean hasMoreElements() {
  23.       PrivilegeManager.checkPrivilegeEnabled(this.target);
  24.       String var1 = this.regNext(false);
  25.       return var1 != null;
  26.    }
  27.  
  28.    public Object nextElement() {
  29.       PrivilegeManager.checkPrivilegeEnabled(this.target);
  30.       this.path = this.regNext(true);
  31.       if (this.path == null) {
  32.          throw new NoSuchElementException("RegKeyEnumerator");
  33.       } else {
  34.          return this.path;
  35.       }
  36.    }
  37.  
  38.    private native String regNext(boolean var1);
  39. }
  40.