MCPcopy Create free account
hub / github.com/MCBans/MCBans / getDouble

Method getDouble

src/main/java/com/mcbans/plugin/org/json/JSONArray.java:234–244  ·  view source on GitHub ↗

Get the double value associated with an index. @param index The index must be between 0 and length() - 1. @return The value. @throws JSONException If the key is not found or if the value cannot be converted to a number.

(int index)

Source from the content-addressed store, hash-verified

232 * be converted to a number.
233 */
234 public double getDouble(int index) throws JSONException {
235 Object object = get(index);
236 try {
237 return object instanceof Number ?
238 ((Number)object).doubleValue() :
239 Double.parseDouble((String)object);
240 } catch (Exception e) {
241 throw new JSONException("JSONArray[" + index +
242 "] is not a number.");
243 }
244 }
245
246
247 /**

Callers 3

optDoubleMethod · 0.95
getMinRepMethod · 0.45
readDoubleMethod · 0.45

Calls 1

getMethod · 0.95

Tested by

no test coverage detected