public static double floatAt(Ur p, String i, double dflt) { if (!(p instanceof Dict)) return dflt; Dict d = (Dict) p; Ur x = d.dict.get(d.terp().newStr(i)); if (!(x instanceof Num)) return dflt; return ((Num) x).num; }
public static String stringAt(Ur p, String i, String dflt) { if (!(p instanceof Dict)) return dflt; Dict d = (Dict) p; Ur x = d.dict.get(d.terp().newStr(i)); if (!(x instanceof Str)) return dflt; return ((Str) x).str; }
public static Html htmlAt(Ur p, String i) { if (!(p instanceof Dict)) { p.terp().toss("In Static.htmlAt, not a dict: <%s#%s>", p.cls, p); } Dict d = (Dict) p; Ur x = d.dict.get(d.terp().newStr(i)); if (!(x instanceof Ht)) { p.terp().toss("In Static.htmlAt, did not find Ht: <%s#%s>", x.cls, x); } return ((Ht) x).html; }
public static Ur urAt(Ur p, String i) { if (!(p instanceof Dict)) return p.terp().instNil; Dict d = (Dict) p; return d.dict.get(d.terp().newStr(i)); }