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

Method getLong

src/main/java/com/mcbans/plugin/org/json/JSONArray.java:309–319  ·  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

307 * be converted to a number.
308 */
309 public long getLong(int index) throws JSONException {
310 Object object = get(index);
311 try {
312 return object instanceof Number ?
313 ((Number)object).longValue() :
314 Long.parseLong((String)object);
315 } catch (Exception e) {
316 throw new JSONException("JSONArray[" + index +
317 "] is not a number.");
318 }
319 }
320
321
322 /**

Callers 4

optLongMethod · 0.95
readLongMethod · 0.45
readByteArrayToStreamMethod · 0.45

Calls 1

getMethod · 0.95

Tested by

no test coverage detected