+ class HashEnum implements java.util.Enumeration {
+ private final Hash parent;
+ private int iterator = 0;
+ private int found = 0;
+
+ public HashEnum (Hash parent) { this.parent = parent; }
+
+ public boolean hasMoreElements() {
+ return found < parent.usedslots;
+ }
+
+ public Object nextElement() {
+ if (!hasMoreElements()) throw new java.util.NoSuchElementException();
+
+ Object o = null;
+ while (o == null) {
+ o = parent.keys1[iterator++];
+ }
+
+ if (o == null) throw new IllegalStateException("Didn't find an element, when I should have.");
+ found++;
+
+ return o;
+ }
+ }