MCPcopy Index your code
hub / github.com/benfry/processing4 / getInt

Method getInt

core/src/processing/data/JSONArray.java:328–337  ·  view source on GitHub ↗

Gets the int value associated with the specified index. @webref jsonarray:method @webBrief Gets the int value associated with the specified index @param index must be between 0 and length() - 1 @return The value. @throws RuntimeException If the key is not found or if the value is not a number. @see

(int index)

Source from the content-addressed store, hash-verified

326 * @see JSONArray#getBoolean(int)
327 */
328 public int getInt(int index) {
329 Object object = this.get(index);
330 try {
331 return object instanceof Number
332 ? ((Number)object).intValue()
333 : Integer.parseInt((String)object);
334 } catch (Exception e) {
335 throw new RuntimeException("JSONArray[" + index + "] is not a number.");
336 }
337 }
338
339
340 /**

Callers 1

toIntArrayMethod · 0.95

Calls 2

getMethod · 0.95
parseIntMethod · 0.80

Tested by

no test coverage detected