MCPcopy Create free account
hub / github.com/Var3D/var3dframe / getInt

Method getInt

core/src/core/java/var3d/net/center/json/JSONArray.java:384–391  ·  view source on GitHub ↗

Returns the value at index if it exists and is an int or can be coerced to an int. @throws JSONException if the value at index doesn't exist or cannot be coerced to a int.

(int index)

Source from the content-addressed store, hash-verified

382 * cannot be coerced to a int.
383 */
384 public int getInt(int index) throws JSONException {
385 Object object = get(index);
386 Integer result = JSON.toInteger(object);
387 if (result == null) {
388 throw JSON.typeMismatch(index, object, "int");
389 }
390 return result;
391 }
392
393 /**
394 * Returns the value at {@code index} if it exists and is an int or

Callers

nothing calls this directly

Calls 3

getMethod · 0.95
toIntegerMethod · 0.95
typeMismatchMethod · 0.95

Tested by

no test coverage detected