Returns the value at index. @param index Which value to get. @return the value at the specified location. @throws JSONException if this array has no value at index, or if that value is the null reference. This method returns normal
(int index)
| 309 | * normally if the value is {@code JSONObject#NULL}. |
| 310 | */ |
| 311 | public Object get(int index) throws JSONException { |
| 312 | try { |
| 313 | Object value = values.get(index); |
| 314 | if (value == null) { |
| 315 | throw new JSONException("Value at " + index + " is null."); |
| 316 | } |
| 317 | return value; |
| 318 | } catch (IndexOutOfBoundsException e) { |
| 319 | throw new JSONException("Index " + index + " out of range [0.." + values.size() + ")"); |
| 320 | } |
| 321 | } |
| 322 | |
| 323 | /** |
| 324 | * Returns the value at {@code index}, or null if the array has no value |
no outgoing calls