MCPcopy Index your code
hub / github.com/VolmitSoftware/Adapt / getLong

Method getLong

src/main/java/com/volmit/adapt/util/JSONArray.java:338–345  ·  view source on GitHub ↗

Get the long 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

336 * to a number.
337 */
338 public long getLong(int index) throws JSONException {
339 Object object = this.get(index);
340 try {
341 return object instanceof Number ? ((Number) object).longValue() : Long.parseLong((String) object);
342 } catch (Exception e) {
343 throw new JSONException("JSONArray[" + index + "] is not a number.");
344 }
345 }
346
347 /**
348 * Get the string associated with an index.

Callers 1

optLongMethod · 0.95

Calls 1

getMethod · 0.95

Tested by

no test coverage detected