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

Method getBoolean

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

Gets the boolean value associated with the specified index. @webref jsonarray:method @webBrief Gets the boolean value associated with the specified index @param index must be between 0 and length() - 1 @return The truth. @throws RuntimeException If there is no value for the index or if the va

(int index)

Source from the content-addressed store, hash-verified

467 * @see JSONArray#getString(int)
468 */
469 public boolean getBoolean(int index) {
470 Object object = this.get(index);
471 if (object.equals(Boolean.FALSE) ||
472 (object instanceof String &&
473 ((String)object).equalsIgnoreCase("false"))) {
474 return false;
475 } else if (object.equals(Boolean.TRUE) ||
476 (object instanceof String &&
477 ((String)object).equalsIgnoreCase("true"))) {
478 return true;
479 }
480 throw new RuntimeException("JSONArray[" + index + "] is not a boolean.");
481 }
482
483
484 /**

Callers 1

toBooleanArrayMethod · 0.95

Calls 2

getMethod · 0.95
equalsMethod · 0.45

Tested by

no test coverage detected