home *** CD-ROM | disk | FTP | other *** search
- package java.util;
-
- class HashtableEnumerator implements Enumeration {
- boolean keys;
- int index;
- HashtableEntry[] table;
- HashtableEntry entry;
-
- HashtableEnumerator(HashtableEntry[] var1, boolean var2) {
- this.table = var1;
- this.keys = var2;
- this.index = var1.length;
- }
-
- public boolean hasMoreElements() {
- if (this.entry != null) {
- return true;
- } else {
- while(this.index-- > 0) {
- if ((this.entry = this.table[this.index]) != null) {
- return true;
- }
- }
-
- return false;
- }
- }
-
- public Object nextElement() {
- if (this.entry == null) {
- while(this.index-- > 0 && (this.entry = this.table[this.index]) == null) {
- }
- }
-
- if (this.entry != null) {
- HashtableEntry var1 = this.entry;
- this.entry = var1.next;
- return this.keys ? var1.key : var1.value;
- } else {
- throw new NoSuchElementException("HashtableEnumerator");
- }
- }
- }
-