home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1998 January / PCO0198.ISO / browser / net_linx / java40.jar / netscape / softupdate / RegKeyEnumerator.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-11-03  |  1.1 KB  |  42 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 PrivilegeManager privMgr;
  14.    private String target;
  15.  
  16.    RegKeyEnumerator(Registry var1, int var2, int var3, String var4) {
  17.       this.reg = var1;
  18.       this.key = var2;
  19.       this.style = var3;
  20.       this.target = var4;
  21.       this.privMgr = PrivilegeManager.getPrivilegeManager();
  22.    }
  23.  
  24.    public boolean hasMoreElements() {
  25.       PrivilegeManager.checkPrivilegeEnabled(this.target);
  26.       String var1 = this.regNext(false);
  27.       return var1 != null;
  28.    }
  29.  
  30.    public Object nextElement() {
  31.       PrivilegeManager.checkPrivilegeEnabled(this.target);
  32.       this.path = this.regNext(true);
  33.       if (this.path == null) {
  34.          throw new NoSuchElementException("RegKeyEnumerator");
  35.       } else {
  36.          return this.path;
  37.       }
  38.    }
  39.  
  40.    private native String regNext(boolean var1);
  41. }
  42.