/** A sensible implementation of the abstract methods in the JS class */
public static class Obj extends JS {
+
+ // FIXME: move these to an interface so they're optional
// this gets around a wierd fluke in the Java type checking rules for ?..:
public static final Object T = Boolean.TRUE;
public static final Object F = Boolean.FALSE;
+
+ // FIXME: be smart here; perhaps intern
+ public static final Number N(int i) { return new Integer(i); }
+ public static final Number N(long l) { return new Long(l); }
+ public static final Number N(double d) { return new Double(d); }
+
+ public static final Boolean B(boolean b) { return b ? Boolean.TRUE : Boolean.FALSE; }
+
private Hash entries = null;
private boolean sealed = false;
public Obj() { this(false); }