public KJ_JSONObject getJSONObject(int index) throws KJ_JSONException { KJ_JSONValue val = arr.get(index); KJ_JSONObject jObj = val.getJSONObject(); if (jObj == null) throw new KJ_JSONException("Not a JSON Object type"); return jObj; }
public String getString(int index) throws KJ_JSONException { KJ_JSONValue val = arr.get(index); String s = val.getString(); if (s == null) throw new KJ_JSONException("Not a string type"); return s; }
public boolean getBoolean(int index) throws KJ_JSONException { KJ_JSONValue val = arr.get(index); Boolean b = val.getBoolean(); if (b == null) throw new KJ_JSONException("Not a boolean type"); return b; }
public double getDouble(int index) throws KJ_JSONException { KJ_JSONValue val = arr.get(index); Double dbl = val.getDouble(); if (dbl == null) throw new KJ_JSONException("Not a double type"); return dbl; }
public String toString() { StringBuilder sb = new StringBuilder("").append("[\n"); for (KJ_JSONValue valItem : arr) { sb.append(valItem.toString()).append(",\n"); } if (sb.length() > 2) sb.delete(sb.length() - 2, sb.length() - 1); sb.append("]\n"); return sb.toString(); }