Get the JSONArray associated with an index. @webref jsonobject:method @brief Gets the JSONArray associated with an index value @param index must be between 0 and length() - 1 @return A JSONArray value. @throws RuntimeException If there is no value for the index. or if the value is not a JSONArray @
(int index)
| 509 | * @see JSONArray#setJSONArray(int, JSONArray) |
| 510 | */ |
| 511 | public JSONArray getJSONArray(int index) { |
| 512 | Object object = this.get(index); |
| 513 | if (object instanceof JSONArray) { |
| 514 | return (JSONArray)object; |
| 515 | } |
| 516 | throw new RuntimeException("JSONArray[" + index + "] is not a JSONArray."); |
| 517 | } |
| 518 | |
| 519 | |
| 520 | public JSONArray getJSONArray(int index, JSONArray defaultValue) { |