Get the JSONObject associated with an index. @webref jsonobject:method @brief Gets the JSONObject associated with an 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 index or if the value is not a JSONObj
(int index)
| 540 | * @see JSONArray#setJSONArray(int, JSONArray) |
| 541 | */ |
| 542 | public JSONObject getJSONObject(int index) { |
| 543 | Object object = this.get(index); |
| 544 | if (object instanceof JSONObject) { |
| 545 | return (JSONObject)object; |
| 546 | } |
| 547 | throw new RuntimeException("JSONArray[" + index + "] is not a JSONObject."); |
| 548 | } |
| 549 | |
| 550 | |
| 551 | public JSONObject getJSONObject(int index, JSONObject defaultValue) { |