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

Method getBoolean

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

Get the boolean value associated with an index. The string values "true" and "false" are converted to boolean. @webref jsonarray:method @brief Gets the boolean value associated with an index @param index must be between 0 and length() - 1 @return The truth. @throws RuntimeException If there is

(int index)

Source from the content-addressed store, hash-verified

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

Callers 1

getBooleanArrayMethod · 0.95

Calls 2

getMethod · 0.95
equalsMethod · 0.45

Tested by

no test coverage detected