Beispiel #1
0
 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;
 }
Beispiel #2
0
 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;
 }
Beispiel #3
0
 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;
 }
Beispiel #4
0
 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));
 }