}
public JS getAndTriggerTraps(JS key) throws JSExn {
Trap t = (Trap)super.get(key, 1);
- return t == null ? (JS)super.get(key) : (JS)new Interpreter(t, null, false).run(null);
+ return t == null ? (JS)get(key) : (JS)new Interpreter(t, null, false).run(null);
}
public JS justTriggerTraps(JS key, JS val) throws JSExn {
Trap t = (Trap)super.get(key, 1);
private final Enumeration parent;
+ public Enumeration() { this(null); }
public Enumeration(Enumeration parent) { this.parent = parent; }
protected abstract boolean _hasNext();
protected JS _next() { throw new NoSuchElementException(); }
}
- public static final class JavaIterator extends Enumeration {
- private final Iterator i;
+ public static class JavaIterator extends Enumeration {
+ protected final Iterator i;
public JavaIterator(Enumeration parent, Iterator i) { super(parent); this.i = i; }
protected boolean _hasNext() { return i.hasNext(); }
protected JS _next() { return (JS)i.next(); }
}
+ public static class JavaStringEnumeration extends Enumeration {
+ protected final java.util.Enumeration e;
+ public JavaStringEnumeration(java.util.Enumeration e) { this.e = e; }
+ protected boolean _hasNext() { return e.hasMoreElements(); }
+ protected JS _next() { return JSU.S(e.nextElement().toString()); }
+ }
+
public static final class RandomAccessList extends Enumeration {
private final List l;
private int pos = 0, size;