home *** CD-ROM | disk | FTP | other *** search
- package java.security;
-
- import java.util.Enumeration;
- import java.util.NoSuchElementException;
-
- final class PermissionsEnumerator implements Enumeration {
- private Enumeration perms;
- private Enumeration permset;
-
- PermissionsEnumerator(Enumeration var1) {
- this.perms = var1;
- this.permset = this.getNextEnumWithMore();
- }
-
- public synchronized boolean hasMoreElements() {
- if (this.permset == null) {
- return false;
- } else if (this.permset.hasMoreElements()) {
- return true;
- } else {
- this.permset = this.getNextEnumWithMore();
- return this.permset != null;
- }
- }
-
- public synchronized Object nextElement() {
- if (this.hasMoreElements()) {
- return this.permset.nextElement();
- } else {
- throw new NoSuchElementException("PermissionsEnumerator");
- }
- }
-
- private Enumeration getNextEnumWithMore() {
- while(this.perms.hasMoreElements()) {
- PermissionCollection var1 = (PermissionCollection)this.perms.nextElement();
- Enumeration var2 = var1.elements();
- if (var2.hasMoreElements()) {
- return var2;
- }
- }
-
- return null;
- }
- }
-