MCPcopy Index your code
hub / github.com/processing/processing / getInt

Method getInt

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

Get the int value associated with an index. @webref jsonarray:method @brief Gets the int value associated with an 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 JSONArray#getFloat(int) @

(int index)

Source from the content-addressed store, hash-verified

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

Callers 1

getIntArrayMethod · 0.95

Calls 2

getMethod · 0.95
parseIntMethod · 0.80

Tested by

no test coverage detected