Retrieves the JSONObject with the associated index value. @webref jsonobject:method @webBrief Retrieves the JSONObject with the associated index value @param index the index value of the object to get @return A JSONObject value. @throws RuntimeException If there is no value for the in
(int index)
| 544 | * @see JSONArray#setJSONArray(int, JSONArray) |
| 545 | */ |
| 546 | public JSONObject getJSONObject(int index) { |
| 547 | Object object = this.get(index); |
| 548 | if (object instanceof JSONObject) { |
| 549 | return (JSONObject)object; |
| 550 | } |
| 551 | throw new RuntimeException("JSONArray[" + index + "] is not a JSONObject."); |
| 552 | } |
| 553 | |
| 554 | |
| 555 | public JSONObject getJSONObject(int index, JSONObject defaultValue) { |