JSON-java/org/json/JSONArray.html
2020-10-06 15:23:44 -05:00

2359 lines
120 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_05) on Tue Oct 06 15:22:52 CDT 2020 -->
<title>JSONArray</title>
<meta name="date" content="2020-10-06">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="JSONArray";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":10,"i28":10,"i29":10,"i30":10,"i31":10,"i32":10,"i33":10,"i34":10,"i35":10,"i36":10,"i37":10,"i38":10,"i39":10,"i40":10,"i41":10,"i42":10,"i43":10,"i44":10,"i45":10,"i46":10,"i47":10,"i48":10,"i49":10,"i50":10,"i51":10,"i52":10,"i53":10,"i54":10,"i55":10,"i56":10,"i57":10,"i58":10,"i59":10,"i60":10,"i61":10,"i62":10,"i63":10,"i64":10,"i65":10,"i66":10,"i67":10,"i68":10,"i69":10,"i70":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../org/json/package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-all.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../org/json/HTTPTokener.html" title="class in org.json"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../org/json/JSONException.html" title="class in org.json"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?org/json/JSONArray.html" target="_top">Frames</a></li>
<li><a href="JSONArray.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.json</div>
<h2 title="Class JSONArray" class="title">Class JSONArray</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>org.json.JSONArray</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a>&lt;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&gt;</dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">JSONArray</span>
extends <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>
implements <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a>&lt;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&gt;</pre>
<div class="block">A JSONArray is an ordered sequence of values. Its external text form is a
string wrapped in square brackets with commas separating the values. The
internal form is an object having <code>get</code> and <code>opt</code>
methods for accessing the values by index, and <code>put</code> methods for
adding or replacing values. The values can be any of these types:
<code>Boolean</code>, <code>JSONArray</code>, <code>JSONObject</code>,
<code>Number</code>, <code>String</code>, or the
<code>JSONObject.NULL object</code>.
<p>
The constructor can convert a JSON text into a Java object. The
<code>toString</code> method converts to JSON text.
<p>
A <code>get</code> method returns a value if one can be found, and throws an
exception if one cannot be found. An <code>opt</code> method returns a
default value instead of throwing an exception, and so is useful for
obtaining optional values.
<p>
The generic <code>get()</code> and <code>opt()</code> methods return an
object which you can cast or query for type. There are also typed
<code>get</code> and <code>opt</code> methods that do type checking and type
coercion for you.
<p>
The texts produced by the <code>toString</code> methods strictly conform to
JSON syntax rules. The constructors are more forgiving in the texts they will
accept:
<ul>
<li>An extra <code>,</code>&nbsp;<small>(comma)</small> may appear just
before the closing bracket.</li>
<li>The <code>null</code> value will be inserted when there is <code>,</code>
&nbsp;<small>(comma)</small> elision.</li>
<li>Strings may be quoted with <code>'</code>&nbsp;<small>(single
quote)</small>.</li>
<li>Strings do not need to be quoted at all if they do not begin with a quote
or single quote, and if they do not contain leading or trailing spaces, and
if they do not contain any of these characters:
<code>{ } [ ] / \ : , #</code> and if they do not look like numbers and
if they are not the reserved words <code>true</code>, <code>false</code>, or
<code>null</code>.</li>
</ul></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#JSONArray--">JSONArray</a></span>()</code>
<div class="block">Construct an empty JSONArray.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#JSONArray-java.util.Collection-">JSONArray</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;?&gt;&nbsp;collection)</code>
<div class="block">Construct a JSONArray from a Collection.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#JSONArray-int-">JSONArray</a></span>(int&nbsp;initialCapacity)</code>
<div class="block">Construct a JSONArray with the specified initial capacity.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#JSONArray-java.lang.Iterable-">JSONArray</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a>&lt;?&gt;&nbsp;iter)</code>
<div class="block">Construct a JSONArray from an Iterable.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#JSONArray-org.json.JSONArray-">JSONArray</a></span>(<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a>&nbsp;array)</code>
<div class="block">Construct a JSONArray from another JSONArray.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#JSONArray-org.json.JSONTokener-">JSONArray</a></span>(<a href="../../org/json/JSONTokener.html" title="class in org.json">JSONTokener</a>&nbsp;x)</code>
<div class="block">Construct a JSONArray from a JSONTokener.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#JSONArray-java.lang.Object-">JSONArray</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;array)</code>
<div class="block">Construct a JSONArray from an array.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#JSONArray-java.lang.String-">JSONArray</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;source)</code>
<div class="block">Construct a JSONArray from a source JSON text.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#get-int-">get</a></span>(int&nbsp;index)</code>
<div class="block">Get the object value associated with an index.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html?is-external=true" title="class or interface in java.math">BigDecimal</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#getBigDecimal-int-">getBigDecimal</a></span>(int&nbsp;index)</code>
<div class="block">Get the BigDecimal value associated with an index.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#getBigInteger-int-">getBigInteger</a></span>(int&nbsp;index)</code>
<div class="block">Get the BigInteger value associated with an index.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#getBoolean-int-">getBoolean</a></span>(int&nbsp;index)</code>
<div class="block">Get the boolean value associated with an index.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#getDouble-int-">getDouble</a></span>(int&nbsp;index)</code>
<div class="block">Get the double value associated with an index.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>&lt;E extends <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang">Enum</a>&lt;E&gt;&gt;<br>E</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#getEnum-java.lang.Class-int-">getEnum</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;E&gt;&nbsp;clazz,
int&nbsp;index)</code>
<div class="block">Get the enum value associated with an index.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>float</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#getFloat-int-">getFloat</a></span>(int&nbsp;index)</code>
<div class="block">Get the float value associated with a key.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#getInt-int-">getInt</a></span>(int&nbsp;index)</code>
<div class="block">Get the int value associated with an index.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code><a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#getJSONArray-int-">getJSONArray</a></span>(int&nbsp;index)</code>
<div class="block">Get the JSONArray associated with an index.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code><a href="../../org/json/JSONObject.html" title="class in org.json">JSONObject</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#getJSONObject-int-">getJSONObject</a></span>(int&nbsp;index)</code>
<div class="block">Get the JSONObject associated with an index.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#getLong-int-">getLong</a></span>(int&nbsp;index)</code>
<div class="block">Get the long value associated with an index.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang">Number</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#getNumber-int-">getNumber</a></span>(int&nbsp;index)</code>
<div class="block">Get the Number value associated with a key.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#getString-int-">getString</a></span>(int&nbsp;index)</code>
<div class="block">Get the string associated with an index.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#isEmpty--">isEmpty</a></span>()</code>
<div class="block">Check if JSONArray is empty.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#isNull-int-">isNull</a></span>(int&nbsp;index)</code>
<div class="block">Determine if the value is <code>null</code>.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</a>&lt;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#iterator--">iterator</a></span>()</code>&nbsp;</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#join-java.lang.String-">join</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;separator)</code>
<div class="block">Make a string from the contents of this JSONArray.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#length--">length</a></span>()</code>
<div class="block">Get the number of elements in the JSONArray, included nulls.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#opt-int-">opt</a></span>(int&nbsp;index)</code>
<div class="block">Get the optional object value associated with an index.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html?is-external=true" title="class or interface in java.math">BigDecimal</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#optBigDecimal-int-java.math.BigDecimal-">optBigDecimal</a></span>(int&nbsp;index,
<a href="https://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html?is-external=true" title="class or interface in java.math">BigDecimal</a>&nbsp;defaultValue)</code>
<div class="block">Get the optional BigDecimal value associated with an index.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#optBigInteger-int-java.math.BigInteger-">optBigInteger</a></span>(int&nbsp;index,
<a href="https://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a>&nbsp;defaultValue)</code>
<div class="block">Get the optional BigInteger value associated with an index.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#optBoolean-int-">optBoolean</a></span>(int&nbsp;index)</code>
<div class="block">Get the optional boolean value associated with an index.</div>
</td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#optBoolean-int-boolean-">optBoolean</a></span>(int&nbsp;index,
boolean&nbsp;defaultValue)</code>
<div class="block">Get the optional boolean value associated with an index.</div>
</td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#optDouble-int-">optDouble</a></span>(int&nbsp;index)</code>
<div class="block">Get the optional double value associated with an index.</div>
</td>
</tr>
<tr id="i24" class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#optDouble-int-double-">optDouble</a></span>(int&nbsp;index,
double&nbsp;defaultValue)</code>
<div class="block">Get the optional double value associated with an index.</div>
</td>
</tr>
<tr id="i25" class="rowColor">
<td class="colFirst"><code>&lt;E extends <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang">Enum</a>&lt;E&gt;&gt;<br>E</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#optEnum-java.lang.Class-int-">optEnum</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;E&gt;&nbsp;clazz,
int&nbsp;index)</code>
<div class="block">Get the enum value associated with a key.</div>
</td>
</tr>
<tr id="i26" class="altColor">
<td class="colFirst"><code>&lt;E extends <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang">Enum</a>&lt;E&gt;&gt;<br>E</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#optEnum-java.lang.Class-int-E-">optEnum</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;E&gt;&nbsp;clazz,
int&nbsp;index,
E&nbsp;defaultValue)</code>
<div class="block">Get the enum value associated with a key.</div>
</td>
</tr>
<tr id="i27" class="rowColor">
<td class="colFirst"><code>float</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#optFloat-int-">optFloat</a></span>(int&nbsp;index)</code>
<div class="block">Get the optional float value associated with an index.</div>
</td>
</tr>
<tr id="i28" class="altColor">
<td class="colFirst"><code>float</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#optFloat-int-float-">optFloat</a></span>(int&nbsp;index,
float&nbsp;defaultValue)</code>
<div class="block">Get the optional float value associated with an index.</div>
</td>
</tr>
<tr id="i29" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#optInt-int-">optInt</a></span>(int&nbsp;index)</code>
<div class="block">Get the optional int value associated with an index.</div>
</td>
</tr>
<tr id="i30" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#optInt-int-int-">optInt</a></span>(int&nbsp;index,
int&nbsp;defaultValue)</code>
<div class="block">Get the optional int value associated with an index.</div>
</td>
</tr>
<tr id="i31" class="rowColor">
<td class="colFirst"><code><a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#optJSONArray-int-">optJSONArray</a></span>(int&nbsp;index)</code>
<div class="block">Get the optional JSONArray associated with an index.</div>
</td>
</tr>
<tr id="i32" class="altColor">
<td class="colFirst"><code><a href="../../org/json/JSONObject.html" title="class in org.json">JSONObject</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#optJSONObject-int-">optJSONObject</a></span>(int&nbsp;index)</code>
<div class="block">Get the optional JSONObject associated with an index.</div>
</td>
</tr>
<tr id="i33" class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#optLong-int-">optLong</a></span>(int&nbsp;index)</code>
<div class="block">Get the optional long value associated with an index.</div>
</td>
</tr>
<tr id="i34" class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#optLong-int-long-">optLong</a></span>(int&nbsp;index,
long&nbsp;defaultValue)</code>
<div class="block">Get the optional long value associated with an index.</div>
</td>
</tr>
<tr id="i35" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang">Number</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#optNumber-int-">optNumber</a></span>(int&nbsp;index)</code>
<div class="block">Get an optional <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang"><code>Number</code></a> value associated with a key, or <code>null</code>
if there is no such key or if the value is not a number.</div>
</td>
</tr>
<tr id="i36" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang">Number</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#optNumber-int-java.lang.Number-">optNumber</a></span>(int&nbsp;index,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang">Number</a>&nbsp;defaultValue)</code>
<div class="block">Get an optional <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang"><code>Number</code></a> value associated with a key, or the default if there
is no such key or if the value is not a number.</div>
</td>
</tr>
<tr id="i37" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#optQuery-org.json.JSONPointer-">optQuery</a></span>(<a href="../../org/json/JSONPointer.html" title="class in org.json">JSONPointer</a>&nbsp;jsonPointer)</code>
<div class="block">Queries and returns a value from this object using <code>jsonPointer</code>, or
returns null if the query fails due to a missing key.</div>
</td>
</tr>
<tr id="i38" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#optQuery-java.lang.String-">optQuery</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;jsonPointer)</code>
<div class="block">Queries and returns a value from this object using <code>jsonPointer</code>, or
returns null if the query fails due to a missing key.</div>
</td>
</tr>
<tr id="i39" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#optString-int-">optString</a></span>(int&nbsp;index)</code>
<div class="block">Get the optional string value associated with an index.</div>
</td>
</tr>
<tr id="i40" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#optString-int-java.lang.String-">optString</a></span>(int&nbsp;index,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;defaultValue)</code>
<div class="block">Get the optional string associated with an index.</div>
</td>
</tr>
<tr id="i41" class="rowColor">
<td class="colFirst"><code><a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#put-boolean-">put</a></span>(boolean&nbsp;value)</code>
<div class="block">Append a boolean value.</div>
</td>
</tr>
<tr id="i42" class="altColor">
<td class="colFirst"><code><a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#put-java.util.Collection-">put</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;?&gt;&nbsp;value)</code>
<div class="block">Put a value in the JSONArray, where the value will be a JSONArray which
is produced from a Collection.</div>
</td>
</tr>
<tr id="i43" class="rowColor">
<td class="colFirst"><code><a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#put-double-">put</a></span>(double&nbsp;value)</code>
<div class="block">Append a double value.</div>
</td>
</tr>
<tr id="i44" class="altColor">
<td class="colFirst"><code><a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#put-float-">put</a></span>(float&nbsp;value)</code>
<div class="block">Append a float value.</div>
</td>
</tr>
<tr id="i45" class="rowColor">
<td class="colFirst"><code><a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#put-int-">put</a></span>(int&nbsp;value)</code>
<div class="block">Append an int value.</div>
</td>
</tr>
<tr id="i46" class="altColor">
<td class="colFirst"><code><a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#put-int-boolean-">put</a></span>(int&nbsp;index,
boolean&nbsp;value)</code>
<div class="block">Put or replace a boolean value in the JSONArray.</div>
</td>
</tr>
<tr id="i47" class="rowColor">
<td class="colFirst"><code><a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#put-int-java.util.Collection-">put</a></span>(int&nbsp;index,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;?&gt;&nbsp;value)</code>
<div class="block">Put a value in the JSONArray, where the value will be a JSONArray which
is produced from a Collection.</div>
</td>
</tr>
<tr id="i48" class="altColor">
<td class="colFirst"><code><a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#put-int-double-">put</a></span>(int&nbsp;index,
double&nbsp;value)</code>
<div class="block">Put or replace a double value.</div>
</td>
</tr>
<tr id="i49" class="rowColor">
<td class="colFirst"><code><a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#put-int-float-">put</a></span>(int&nbsp;index,
float&nbsp;value)</code>
<div class="block">Put or replace a float value.</div>
</td>
</tr>
<tr id="i50" class="altColor">
<td class="colFirst"><code><a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#put-int-int-">put</a></span>(int&nbsp;index,
int&nbsp;value)</code>
<div class="block">Put or replace an int value.</div>
</td>
</tr>
<tr id="i51" class="rowColor">
<td class="colFirst"><code><a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#put-int-long-">put</a></span>(int&nbsp;index,
long&nbsp;value)</code>
<div class="block">Put or replace a long value.</div>
</td>
</tr>
<tr id="i52" class="altColor">
<td class="colFirst"><code><a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#put-int-java.util.Map-">put</a></span>(int&nbsp;index,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;?,?&gt;&nbsp;value)</code>
<div class="block">Put a value in the JSONArray, where the value will be a JSONObject that
is produced from a Map.</div>
</td>
</tr>
<tr id="i53" class="rowColor">
<td class="colFirst"><code><a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#put-int-java.lang.Object-">put</a></span>(int&nbsp;index,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;value)</code>
<div class="block">Put or replace an object value in the JSONArray.</div>
</td>
</tr>
<tr id="i54" class="altColor">
<td class="colFirst"><code><a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#put-long-">put</a></span>(long&nbsp;value)</code>
<div class="block">Append an long value.</div>
</td>
</tr>
<tr id="i55" class="rowColor">
<td class="colFirst"><code><a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#put-java.util.Map-">put</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;?,?&gt;&nbsp;value)</code>
<div class="block">Put a value in the JSONArray, where the value will be a JSONObject which
is produced from a Map.</div>
</td>
</tr>
<tr id="i56" class="altColor">
<td class="colFirst"><code><a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#put-java.lang.Object-">put</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;value)</code>
<div class="block">Append an object value.</div>
</td>
</tr>
<tr id="i57" class="rowColor">
<td class="colFirst"><code><a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#putAll-java.util.Collection-">putAll</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;?&gt;&nbsp;collection)</code>
<div class="block">Put a collection's elements in to the JSONArray.</div>
</td>
</tr>
<tr id="i58" class="altColor">
<td class="colFirst"><code><a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#putAll-java.lang.Iterable-">putAll</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a>&lt;?&gt;&nbsp;iter)</code>
<div class="block">Put an Iterable's elements in to the JSONArray.</div>
</td>
</tr>
<tr id="i59" class="rowColor">
<td class="colFirst"><code><a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#putAll-org.json.JSONArray-">putAll</a></span>(<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a>&nbsp;array)</code>
<div class="block">Put a JSONArray's elements in to the JSONArray.</div>
</td>
</tr>
<tr id="i60" class="altColor">
<td class="colFirst"><code><a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#putAll-java.lang.Object-">putAll</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;array)</code>
<div class="block">Put an array's elements in to the JSONArray.</div>
</td>
</tr>
<tr id="i61" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#query-org.json.JSONPointer-">query</a></span>(<a href="../../org/json/JSONPointer.html" title="class in org.json">JSONPointer</a>&nbsp;jsonPointer)</code>
<div class="block">Uses a user initialized JSONPointer and tries to
match it to an item within this JSONArray.</div>
</td>
</tr>
<tr id="i62" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#query-java.lang.String-">query</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;jsonPointer)</code>
<div class="block">Creates a JSONPointer using an initialization string and tries to
match it to an item within this JSONArray.</div>
</td>
</tr>
<tr id="i63" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#remove-int-">remove</a></span>(int&nbsp;index)</code>
<div class="block">Remove an index and close the hole.</div>
</td>
</tr>
<tr id="i64" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#similar-java.lang.Object-">similar</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;other)</code>
<div class="block">Determine if two JSONArrays are similar.</div>
</td>
</tr>
<tr id="i65" class="rowColor">
<td class="colFirst"><code><a href="../../org/json/JSONObject.html" title="class in org.json">JSONObject</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#toJSONObject-org.json.JSONArray-">toJSONObject</a></span>(<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a>&nbsp;names)</code>
<div class="block">Produce a JSONObject by combining a JSONArray of names with the values of
this JSONArray.</div>
</td>
</tr>
<tr id="i66" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#toList--">toList</a></span>()</code>
<div class="block">Returns a java.util.List containing all of the elements in this array.</div>
</td>
</tr>
<tr id="i67" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#toString--">toString</a></span>()</code>
<div class="block">Make a JSON text of this JSONArray.</div>
</td>
</tr>
<tr id="i68" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#toString-int-">toString</a></span>(int&nbsp;indentFactor)</code>
<div class="block">Make a pretty-printed JSON text of this JSONArray.</div>
</td>
</tr>
<tr id="i69" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/io/Writer.html?is-external=true" title="class or interface in java.io">Writer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#write-java.io.Writer-">write</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/io/Writer.html?is-external=true" title="class or interface in java.io">Writer</a>&nbsp;writer)</code>
<div class="block">Write the contents of the JSONArray as JSON text to a writer.</div>
</td>
</tr>
<tr id="i70" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/7/docs/api/java/io/Writer.html?is-external=true" title="class or interface in java.io">Writer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#write-java.io.Writer-int-int-">write</a></span>(<a href="https://docs.oracle.com/javase/7/docs/api/java/io/Writer.html?is-external=true" title="class or interface in java.io">Writer</a>&nbsp;writer,
int&nbsp;indentFactor,
int&nbsp;indent)</code>
<div class="block">Write the contents of the JSONArray as JSON text to a writer.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Iterable">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;java.lang.<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a></h3>
<code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Iterable.html?is-external=true#forEach-java.util.function.Consumer-" title="class or interface in java.lang">forEach</a>, <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Iterable.html?is-external=true#spliterator--" title="class or interface in java.lang">spliterator</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="JSONArray--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>JSONArray</h4>
<pre>public&nbsp;JSONArray()</pre>
<div class="block">Construct an empty JSONArray.</div>
</li>
</ul>
<a name="JSONArray-org.json.JSONTokener-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>JSONArray</h4>
<pre>public&nbsp;JSONArray(<a href="../../org/json/JSONTokener.html" title="class in org.json">JSONTokener</a>&nbsp;x)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Construct a JSONArray from a JSONTokener.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>x</code> - A JSONTokener</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If there is a syntax error.</dd>
</dl>
</li>
</ul>
<a name="JSONArray-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>JSONArray</h4>
<pre>public&nbsp;JSONArray(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;source)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Construct a JSONArray from a source JSON text.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>source</code> - A string that begins with <code>[</code>&nbsp;<small>(left
bracket)</small> and ends with <code>]</code>
&nbsp;<small>(right bracket)</small>.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If there is a syntax error.</dd>
</dl>
</li>
</ul>
<a name="JSONArray-java.util.Collection-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>JSONArray</h4>
<pre>public&nbsp;JSONArray(<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;?&gt;&nbsp;collection)</pre>
<div class="block">Construct a JSONArray from a Collection.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>collection</code> - A Collection.</dd>
</dl>
</li>
</ul>
<a name="JSONArray-java.lang.Iterable-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>JSONArray</h4>
<pre>public&nbsp;JSONArray(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a>&lt;?&gt;&nbsp;iter)</pre>
<div class="block">Construct a JSONArray from an Iterable. This is a shallow copy.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>iter</code> - A Iterable collection.</dd>
</dl>
</li>
</ul>
<a name="JSONArray-org.json.JSONArray-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>JSONArray</h4>
<pre>public&nbsp;JSONArray(<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a>&nbsp;array)</pre>
<div class="block">Construct a JSONArray from another JSONArray. This is a shallow copy.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>array</code> - A array.</dd>
</dl>
</li>
</ul>
<a name="JSONArray-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>JSONArray</h4>
<pre>public&nbsp;JSONArray(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;array)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Construct a JSONArray from an array.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>array</code> - Array. If the parameter passed is null, or not an array, an
exception will be thrown.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If not an array or if an array value is non-finite number.</dd>
<dd><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - Thrown if the array parameter is null.</dd>
</dl>
</li>
</ul>
<a name="JSONArray-int-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>JSONArray</h4>
<pre>public&nbsp;JSONArray(int&nbsp;initialCapacity)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Construct a JSONArray with the specified initial capacity.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>initialCapacity</code> - the initial capacity of the JSONArray.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If the initial capacity is negative.</dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="iterator--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>iterator</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</a>&lt;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&gt;&nbsp;iterator()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Iterable.html?is-external=true#iterator--" title="class or interface in java.lang">iterator</a></code>&nbsp;in interface&nbsp;<code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a>&lt;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&gt;</code></dd>
</dl>
</li>
</ul>
<a name="get-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>get</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;get(int&nbsp;index)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Get the object value associated with an index.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>An object value.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If there is no value for the index.</dd>
</dl>
</li>
</ul>
<a name="getBoolean-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBoolean</h4>
<pre>public&nbsp;boolean&nbsp;getBoolean(int&nbsp;index)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Get the boolean value associated with an index. The string values "true"
and "false" are converted to boolean.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The truth.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If there is no value for the index or if the value is not
convertible to boolean.</dd>
</dl>
</li>
</ul>
<a name="getDouble-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDouble</h4>
<pre>public&nbsp;double&nbsp;getDouble(int&nbsp;index)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Get the double value associated with an index.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The value.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If the key is not found or if the value cannot be converted
to a number.</dd>
</dl>
</li>
</ul>
<a name="getFloat-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFloat</h4>
<pre>public&nbsp;float&nbsp;getFloat(int&nbsp;index)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Get the float value associated with a key.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The numeric value.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - if the key is not found or if the value is not a Number
object and cannot be converted to a number.</dd>
</dl>
</li>
</ul>
<a name="getNumber-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNumber</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang">Number</a>&nbsp;getNumber(int&nbsp;index)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Get the Number value associated with a key.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The numeric value.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - if the key is not found or if the value is not a Number
object and cannot be converted to a number.</dd>
</dl>
</li>
</ul>
<a name="getEnum-java.lang.Class-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getEnum</h4>
<pre>public&nbsp;&lt;E extends <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang">Enum</a>&lt;E&gt;&gt;&nbsp;E&nbsp;getEnum(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;E&gt;&nbsp;clazz,
int&nbsp;index)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Get the enum value associated with an index.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>E</code> - Enum Type</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>clazz</code> - The type of enum to retrieve.</dd>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The enum value at the index location</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - if the key is not found or if the value cannot be converted
to an enum.</dd>
</dl>
</li>
</ul>
<a name="getBigDecimal-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBigDecimal</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html?is-external=true" title="class or interface in java.math">BigDecimal</a>&nbsp;getBigDecimal(int&nbsp;index)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Get the BigDecimal value associated with an index. If the value is float
or double, the the <a href="https://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html?is-external=true#BigDecimal-double-" title="class or interface in java.math"><code>BigDecimal.BigDecimal(double)</code></a> constructor
will be used. See notes on the constructor for conversion issues that
may arise.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The value.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If the key is not found or if the value cannot be converted
to a BigDecimal.</dd>
</dl>
</li>
</ul>
<a name="getBigInteger-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBigInteger</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a>&nbsp;getBigInteger(int&nbsp;index)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Get the BigInteger value associated with an index.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The value.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If the key is not found or if the value cannot be converted
to a BigInteger.</dd>
</dl>
</li>
</ul>
<a name="getInt-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getInt</h4>
<pre>public&nbsp;int&nbsp;getInt(int&nbsp;index)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Get the int value associated with an index.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The value.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If the key is not found or if the value is not a number.</dd>
</dl>
</li>
</ul>
<a name="getJSONArray-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getJSONArray</h4>
<pre>public&nbsp;<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a>&nbsp;getJSONArray(int&nbsp;index)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Get the JSONArray associated with an index.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A JSONArray value.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If there is no value for the index. or if the value is not a
JSONArray</dd>
</dl>
</li>
</ul>
<a name="getJSONObject-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getJSONObject</h4>
<pre>public&nbsp;<a href="../../org/json/JSONObject.html" title="class in org.json">JSONObject</a>&nbsp;getJSONObject(int&nbsp;index)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Get the JSONObject associated with an index.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - subscript</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A JSONObject value.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If there is no value for the index or if the value is not a
JSONObject</dd>
</dl>
</li>
</ul>
<a name="getLong-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLong</h4>
<pre>public&nbsp;long&nbsp;getLong(int&nbsp;index)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Get the long value associated with an index.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The value.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If the key is not found or if the value cannot be converted
to a number.</dd>
</dl>
</li>
</ul>
<a name="getString-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getString</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getString(int&nbsp;index)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Get the string associated with an index.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A string value.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If there is no string value for the index.</dd>
</dl>
</li>
</ul>
<a name="isNull-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isNull</h4>
<pre>public&nbsp;boolean&nbsp;isNull(int&nbsp;index)</pre>
<div class="block">Determine if the value is <code>null</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the value at the index is <code>null</code>, or if there is no value.</dd>
</dl>
</li>
</ul>
<a name="join-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>join</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;join(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;separator)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Make a string from the contents of this JSONArray. The
<code>separator</code> string is inserted between each element. Warning:
This method assumes that the data structure is acyclical.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>separator</code> - A string that will be inserted between the elements.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a string.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If the array contains an invalid number.</dd>
</dl>
</li>
</ul>
<a name="length--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>length</h4>
<pre>public&nbsp;int&nbsp;length()</pre>
<div class="block">Get the number of elements in the JSONArray, included nulls.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The length (or size).</dd>
</dl>
</li>
</ul>
<a name="opt-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>opt</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;opt(int&nbsp;index)</pre>
<div class="block">Get the optional object value associated with an index.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index must be between 0 and length() - 1. If not, null is returned.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>An object value, or null if there is no object at that index.</dd>
</dl>
</li>
</ul>
<a name="optBoolean-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>optBoolean</h4>
<pre>public&nbsp;boolean&nbsp;optBoolean(int&nbsp;index)</pre>
<div class="block">Get the optional boolean value associated with an index. It returns false
if there is no value at that index, or if the value is not Boolean.TRUE
or the String "true".</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The truth.</dd>
</dl>
</li>
</ul>
<a name="optBoolean-int-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>optBoolean</h4>
<pre>public&nbsp;boolean&nbsp;optBoolean(int&nbsp;index,
boolean&nbsp;defaultValue)</pre>
<div class="block">Get the optional boolean value associated with an index. It returns the
defaultValue if there is no value at that index or if it is not a Boolean
or the String "true" or "false" (case insensitive).</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dd><code>defaultValue</code> - A boolean default.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The truth.</dd>
</dl>
</li>
</ul>
<a name="optDouble-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>optDouble</h4>
<pre>public&nbsp;double&nbsp;optDouble(int&nbsp;index)</pre>
<div class="block">Get the optional double value associated with an index. NaN is returned
if there is no value for the index, or if the value is not a number and
cannot be converted to a number.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The value.</dd>
</dl>
</li>
</ul>
<a name="optDouble-int-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>optDouble</h4>
<pre>public&nbsp;double&nbsp;optDouble(int&nbsp;index,
double&nbsp;defaultValue)</pre>
<div class="block">Get the optional double value associated with an index. The defaultValue
is returned if there is no value for the index, or if the value is not a
number and cannot be converted to a number.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - subscript</dd>
<dd><code>defaultValue</code> - The default value.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The value.</dd>
</dl>
</li>
</ul>
<a name="optFloat-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>optFloat</h4>
<pre>public&nbsp;float&nbsp;optFloat(int&nbsp;index)</pre>
<div class="block">Get the optional float value associated with an index. NaN is returned
if there is no value for the index, or if the value is not a number and
cannot be converted to a number.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The value.</dd>
</dl>
</li>
</ul>
<a name="optFloat-int-float-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>optFloat</h4>
<pre>public&nbsp;float&nbsp;optFloat(int&nbsp;index,
float&nbsp;defaultValue)</pre>
<div class="block">Get the optional float value associated with an index. The defaultValue
is returned if there is no value for the index, or if the value is not a
number and cannot be converted to a number.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - subscript</dd>
<dd><code>defaultValue</code> - The default value.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The value.</dd>
</dl>
</li>
</ul>
<a name="optInt-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>optInt</h4>
<pre>public&nbsp;int&nbsp;optInt(int&nbsp;index)</pre>
<div class="block">Get the optional int value associated with an index. Zero is returned if
there is no value for the index, or if the value is not a number and
cannot be converted to a number.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The value.</dd>
</dl>
</li>
</ul>
<a name="optInt-int-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>optInt</h4>
<pre>public&nbsp;int&nbsp;optInt(int&nbsp;index,
int&nbsp;defaultValue)</pre>
<div class="block">Get the optional int value associated with an index. The defaultValue is
returned if there is no value for the index, or if the value is not a
number and cannot be converted to a number.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dd><code>defaultValue</code> - The default value.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The value.</dd>
</dl>
</li>
</ul>
<a name="optEnum-java.lang.Class-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>optEnum</h4>
<pre>public&nbsp;&lt;E extends <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang">Enum</a>&lt;E&gt;&gt;&nbsp;E&nbsp;optEnum(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;E&gt;&nbsp;clazz,
int&nbsp;index)</pre>
<div class="block">Get the enum value associated with a key.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>E</code> - Enum Type</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>clazz</code> - The type of enum to retrieve.</dd>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The enum value at the index location or null if not found</dd>
</dl>
</li>
</ul>
<a name="optEnum-java.lang.Class-int-java.lang.Enum-">
<!-- -->
</a><a name="optEnum-java.lang.Class-int-E-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>optEnum</h4>
<pre>public&nbsp;&lt;E extends <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Enum.html?is-external=true" title="class or interface in java.lang">Enum</a>&lt;E&gt;&gt;&nbsp;E&nbsp;optEnum(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;E&gt;&nbsp;clazz,
int&nbsp;index,
E&nbsp;defaultValue)</pre>
<div class="block">Get the enum value associated with a key.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>E</code> - Enum Type</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>clazz</code> - The type of enum to retrieve.</dd>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dd><code>defaultValue</code> - The default in case the value is not found</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The enum value at the index location or defaultValue if
the value is not found or cannot be assigned to clazz</dd>
</dl>
</li>
</ul>
<a name="optBigInteger-int-java.math.BigInteger-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>optBigInteger</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a>&nbsp;optBigInteger(int&nbsp;index,
<a href="https://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html?is-external=true" title="class or interface in java.math">BigInteger</a>&nbsp;defaultValue)</pre>
<div class="block">Get the optional BigInteger value associated with an index. The
defaultValue is returned if there is no value for the index, or if the
value is not a number and cannot be converted to a number.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dd><code>defaultValue</code> - The default value.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The value.</dd>
</dl>
</li>
</ul>
<a name="optBigDecimal-int-java.math.BigDecimal-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>optBigDecimal</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html?is-external=true" title="class or interface in java.math">BigDecimal</a>&nbsp;optBigDecimal(int&nbsp;index,
<a href="https://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html?is-external=true" title="class or interface in java.math">BigDecimal</a>&nbsp;defaultValue)</pre>
<div class="block">Get the optional BigDecimal value associated with an index. The
defaultValue is returned if there is no value for the index, or if the
value is not a number and cannot be converted to a number. If the value
is float or double, the the <a href="https://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html?is-external=true#BigDecimal-double-" title="class or interface in java.math"><code>BigDecimal.BigDecimal(double)</code></a>
constructor will be used. See notes on the constructor for conversion
issues that may arise.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dd><code>defaultValue</code> - The default value.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The value.</dd>
</dl>
</li>
</ul>
<a name="optJSONArray-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>optJSONArray</h4>
<pre>public&nbsp;<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a>&nbsp;optJSONArray(int&nbsp;index)</pre>
<div class="block">Get the optional JSONArray associated with an index.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - subscript</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A JSONArray value, or null if the index has no value, or if the
value is not a JSONArray.</dd>
</dl>
</li>
</ul>
<a name="optJSONObject-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>optJSONObject</h4>
<pre>public&nbsp;<a href="../../org/json/JSONObject.html" title="class in org.json">JSONObject</a>&nbsp;optJSONObject(int&nbsp;index)</pre>
<div class="block">Get the optional JSONObject associated with an index. Null is returned if
the key is not found, or null if the index has no value, or if the value
is not a JSONObject.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A JSONObject value.</dd>
</dl>
</li>
</ul>
<a name="optLong-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>optLong</h4>
<pre>public&nbsp;long&nbsp;optLong(int&nbsp;index)</pre>
<div class="block">Get the optional long value associated with an index. Zero is returned if
there is no value for the index, or if the value is not a number and
cannot be converted to a number.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The value.</dd>
</dl>
</li>
</ul>
<a name="optLong-int-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>optLong</h4>
<pre>public&nbsp;long&nbsp;optLong(int&nbsp;index,
long&nbsp;defaultValue)</pre>
<div class="block">Get the optional long value associated with an index. The defaultValue is
returned if there is no value for the index, or if the value is not a
number and cannot be converted to a number.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dd><code>defaultValue</code> - The default value.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The value.</dd>
</dl>
</li>
</ul>
<a name="optNumber-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>optNumber</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang">Number</a>&nbsp;optNumber(int&nbsp;index)</pre>
<div class="block">Get an optional <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang"><code>Number</code></a> value associated with a key, or <code>null</code>
if there is no such key or if the value is not a number. If the value is a string,
an attempt will be made to evaluate it as a number (<a href="https://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html?is-external=true" title="class or interface in java.math"><code>BigDecimal</code></a>). This method
would be used in cases where type coercion of the number value is unwanted.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>An object which is the value.</dd>
</dl>
</li>
</ul>
<a name="optNumber-int-java.lang.Number-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>optNumber</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang">Number</a>&nbsp;optNumber(int&nbsp;index,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang">Number</a>&nbsp;defaultValue)</pre>
<div class="block">Get an optional <a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang"><code>Number</code></a> value associated with a key, or the default if there
is no such key or if the value is not a number. If the value is a string,
an attempt will be made to evaluate it as a number (<a href="https://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html?is-external=true" title="class or interface in java.math"><code>BigDecimal</code></a>). This method
would be used in cases where type coercion of the number value is unwanted.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dd><code>defaultValue</code> - The default.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>An object which is the value.</dd>
</dl>
</li>
</ul>
<a name="optString-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>optString</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;optString(int&nbsp;index)</pre>
<div class="block">Get the optional string value associated with an index. It returns an
empty string if there is no value at that index. If the value is not a
string and is not null, then it is converted to a string.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A String value.</dd>
</dl>
</li>
</ul>
<a name="optString-int-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>optString</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;optString(int&nbsp;index,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;defaultValue)</pre>
<div class="block">Get the optional string associated with an index. The defaultValue is
returned if the key is not found.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
<dd><code>defaultValue</code> - The default value.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A String value.</dd>
</dl>
</li>
</ul>
<a name="put-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>put</h4>
<pre>public&nbsp;<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a>&nbsp;put(boolean&nbsp;value)</pre>
<div class="block">Append a boolean value. This increases the array's length by one.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - A boolean value.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this.</dd>
</dl>
</li>
</ul>
<a name="put-java.util.Collection-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>put</h4>
<pre>public&nbsp;<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a>&nbsp;put(<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;?&gt;&nbsp;value)</pre>
<div class="block">Put a value in the JSONArray, where the value will be a JSONArray which
is produced from a Collection.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - A Collection value.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If the value is non-finite number.</dd>
</dl>
</li>
</ul>
<a name="put-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>put</h4>
<pre>public&nbsp;<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a>&nbsp;put(double&nbsp;value)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Append a double value. This increases the array's length by one.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - A double value.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - if the value is not finite.</dd>
</dl>
</li>
</ul>
<a name="put-float-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>put</h4>
<pre>public&nbsp;<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a>&nbsp;put(float&nbsp;value)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Append a float value. This increases the array's length by one.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - A float value.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - if the value is not finite.</dd>
</dl>
</li>
</ul>
<a name="put-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>put</h4>
<pre>public&nbsp;<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a>&nbsp;put(int&nbsp;value)</pre>
<div class="block">Append an int value. This increases the array's length by one.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - An int value.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this.</dd>
</dl>
</li>
</ul>
<a name="put-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>put</h4>
<pre>public&nbsp;<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a>&nbsp;put(long&nbsp;value)</pre>
<div class="block">Append an long value. This increases the array's length by one.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - A long value.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this.</dd>
</dl>
</li>
</ul>
<a name="put-java.util.Map-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>put</h4>
<pre>public&nbsp;<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a>&nbsp;put(<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;?,?&gt;&nbsp;value)</pre>
<div class="block">Put a value in the JSONArray, where the value will be a JSONObject which
is produced from a Map.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - A Map value.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If a value in the map is non-finite number.</dd>
<dd><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - If a key in the map is <code>null</code></dd>
</dl>
</li>
</ul>
<a name="put-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>put</h4>
<pre>public&nbsp;<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a>&nbsp;put(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;value)</pre>
<div class="block">Append an object value. This increases the array's length by one.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>value</code> - An object value. The value should be a Boolean, Double,
Integer, JSONArray, JSONObject, Long, or String, or the
JSONObject.NULL object.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If the value is non-finite number.</dd>
</dl>
</li>
</ul>
<a name="put-int-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>put</h4>
<pre>public&nbsp;<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a>&nbsp;put(int&nbsp;index,
boolean&nbsp;value)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Put or replace a boolean value in the JSONArray. If the index is greater
than the length of the JSONArray, then null elements will be added as
necessary to pad it out.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The subscript.</dd>
<dd><code>value</code> - A boolean value.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If the index is negative.</dd>
</dl>
</li>
</ul>
<a name="put-int-java.util.Collection-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>put</h4>
<pre>public&nbsp;<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a>&nbsp;put(int&nbsp;index,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;?&gt;&nbsp;value)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Put a value in the JSONArray, where the value will be a JSONArray which
is produced from a Collection.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The subscript.</dd>
<dd><code>value</code> - A Collection value.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If the index is negative or if the value is non-finite.</dd>
</dl>
</li>
</ul>
<a name="put-int-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>put</h4>
<pre>public&nbsp;<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a>&nbsp;put(int&nbsp;index,
double&nbsp;value)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Put or replace a double value. If the index is greater than the length of
the JSONArray, then null elements will be added as necessary to pad it
out.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The subscript.</dd>
<dd><code>value</code> - A double value.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If the index is negative or if the value is non-finite.</dd>
</dl>
</li>
</ul>
<a name="put-int-float-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>put</h4>
<pre>public&nbsp;<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a>&nbsp;put(int&nbsp;index,
float&nbsp;value)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Put or replace a float value. If the index is greater than the length of
the JSONArray, then null elements will be added as necessary to pad it
out.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The subscript.</dd>
<dd><code>value</code> - A float value.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If the index is negative or if the value is non-finite.</dd>
</dl>
</li>
</ul>
<a name="put-int-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>put</h4>
<pre>public&nbsp;<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a>&nbsp;put(int&nbsp;index,
int&nbsp;value)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Put or replace an int value. If the index is greater than the length of
the JSONArray, then null elements will be added as necessary to pad it
out.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The subscript.</dd>
<dd><code>value</code> - An int value.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If the index is negative.</dd>
</dl>
</li>
</ul>
<a name="put-int-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>put</h4>
<pre>public&nbsp;<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a>&nbsp;put(int&nbsp;index,
long&nbsp;value)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Put or replace a long value. If the index is greater than the length of
the JSONArray, then null elements will be added as necessary to pad it
out.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The subscript.</dd>
<dd><code>value</code> - A long value.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If the index is negative.</dd>
</dl>
</li>
</ul>
<a name="put-int-java.util.Map-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>put</h4>
<pre>public&nbsp;<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a>&nbsp;put(int&nbsp;index,
<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;?,?&gt;&nbsp;value)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Put a value in the JSONArray, where the value will be a JSONObject that
is produced from a Map.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The subscript.</dd>
<dd><code>value</code> - The Map value.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If the index is negative or if the the value is an invalid
number.</dd>
<dd><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - If a key in the map is <code>null</code></dd>
</dl>
</li>
</ul>
<a name="put-int-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>put</h4>
<pre>public&nbsp;<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a>&nbsp;put(int&nbsp;index,
<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;value)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Put or replace an object value in the JSONArray. If the index is greater
than the length of the JSONArray, then null elements will be added as
necessary to pad it out.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The subscript.</dd>
<dd><code>value</code> - The value to put into the array. The value should be a
Boolean, Double, Integer, JSONArray, JSONObject, Long, or
String, or the JSONObject.NULL object.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If the index is negative or if the the value is an invalid
number.</dd>
</dl>
</li>
</ul>
<a name="putAll-java.util.Collection-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>putAll</h4>
<pre>public&nbsp;<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a>&nbsp;putAll(<a href="https://docs.oracle.com/javase/7/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;?&gt;&nbsp;collection)</pre>
<div class="block">Put a collection's elements in to the JSONArray.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>collection</code> - A Collection.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this.</dd>
</dl>
</li>
</ul>
<a name="putAll-java.lang.Iterable-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>putAll</h4>
<pre>public&nbsp;<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a>&nbsp;putAll(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a>&lt;?&gt;&nbsp;iter)</pre>
<div class="block">Put an Iterable's elements in to the JSONArray.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>iter</code> - An Iterable.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this.</dd>
</dl>
</li>
</ul>
<a name="putAll-org.json.JSONArray-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>putAll</h4>
<pre>public&nbsp;<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a>&nbsp;putAll(<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a>&nbsp;array)</pre>
<div class="block">Put a JSONArray's elements in to the JSONArray.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>array</code> - A JSONArray.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this.</dd>
</dl>
</li>
</ul>
<a name="putAll-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>putAll</h4>
<pre>public&nbsp;<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a>&nbsp;putAll(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;array)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Put an array's elements in to the JSONArray.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>array</code> - Array. If the parameter passed is null, or not an array or Iterable, an
exception will be thrown.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If not an array, JSONArray, Iterable or if an value is non-finite number.</dd>
<dd><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - Thrown if the array parameter is null.</dd>
</dl>
</li>
</ul>
<a name="query-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>query</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;query(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;jsonPointer)</pre>
<div class="block">Creates a JSONPointer using an initialization string and tries to
match it to an item within this JSONArray. For example, given a
JSONArray initialized with this document:
<pre>
[
{"b":"c"}
]
</pre>
and this JSONPointer string:
<pre>
"/0/b"
</pre>
Then this method will return the String "c"
A JSONPointerException may be thrown from code called by this method.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>jsonPointer</code> - string that can be used to create a JSONPointer</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the item matched by the JSONPointer, otherwise null</dd>
</dl>
</li>
</ul>
<a name="query-org.json.JSONPointer-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>query</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;query(<a href="../../org/json/JSONPointer.html" title="class in org.json">JSONPointer</a>&nbsp;jsonPointer)</pre>
<div class="block">Uses a user initialized JSONPointer and tries to
match it to an item within this JSONArray. For example, given a
JSONArray initialized with this document:
<pre>
[
{"b":"c"}
]
</pre>
and this JSONPointer:
<pre>
"/0/b"
</pre>
Then this method will return the String "c"
A JSONPointerException may be thrown from code called by this method.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>jsonPointer</code> - string that can be used to create a JSONPointer</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the item matched by the JSONPointer, otherwise null</dd>
</dl>
</li>
</ul>
<a name="optQuery-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>optQuery</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;optQuery(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;jsonPointer)</pre>
<div class="block">Queries and returns a value from this object using <code>jsonPointer</code>, or
returns null if the query fails due to a missing key.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>jsonPointer</code> - the string representation of the JSON pointer</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the queried value or <code>null</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if <code>jsonPointer</code> has invalid syntax</dd>
</dl>
</li>
</ul>
<a name="optQuery-org.json.JSONPointer-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>optQuery</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;optQuery(<a href="../../org/json/JSONPointer.html" title="class in org.json">JSONPointer</a>&nbsp;jsonPointer)</pre>
<div class="block">Queries and returns a value from this object using <code>jsonPointer</code>, or
returns null if the query fails due to a missing key.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>jsonPointer</code> - The JSON pointer</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the queried value or <code>null</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if <code>jsonPointer</code> has invalid syntax</dd>
</dl>
</li>
</ul>
<a name="remove-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>remove</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;remove(int&nbsp;index)</pre>
<div class="block">Remove an index and close the hole.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - The index of the element to be removed.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The value that was associated with the index, or null if there
was no value.</dd>
</dl>
</li>
</ul>
<a name="similar-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>similar</h4>
<pre>public&nbsp;boolean&nbsp;similar(<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;other)</pre>
<div class="block">Determine if two JSONArrays are similar.
They must contain similar sequences.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>other</code> - The other JSONArray</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if they are equal</dd>
</dl>
</li>
</ul>
<a name="toJSONObject-org.json.JSONArray-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toJSONObject</h4>
<pre>public&nbsp;<a href="../../org/json/JSONObject.html" title="class in org.json">JSONObject</a>&nbsp;toJSONObject(<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a>&nbsp;names)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Produce a JSONObject by combining a JSONArray of names with the values of
this JSONArray.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>names</code> - A JSONArray containing a list of key strings. These will be
paired with the values.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A JSONObject, or null if there are no names or if this JSONArray
has no values.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If any of the names are null.</dd>
</dl>
</li>
</ul>
<a name="toString--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;toString()</pre>
<div class="block">Make a JSON text of this JSONArray. For compactness, no unnecessary
whitespace is added. If it is not possible to produce a syntactically
correct JSON text then null will be returned instead. This could occur if
the array contains an invalid number.
<p><b>
Warning: This method assumes that the data structure is acyclical.
</b></div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a></code>&nbsp;in class&nbsp;<code><a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a printable, displayable, transmittable representation of the
array.</dd>
</dl>
</li>
</ul>
<a name="toString-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;toString(int&nbsp;indentFactor)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Make a pretty-printed JSON text of this JSONArray.
<p>If <pre> <code> indentFactor &gt; 0</code></pre> and the <a href="../../org/json/JSONArray.html" title="class in org.json"><code>JSONArray</code></a> has only
one element, then the array will be output on a single line:
<pre><code> [1]</code></pre>
<p>If an array has 2 or more elements, then it will be output across
multiple lines: <pre><code>
[
1,
"value 2",
3
]
</code></pre>
<p><b>
Warning: This method assumes that the data structure is acyclical.
</b></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>indentFactor</code> - The number of spaces to add to each level of indentation.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a printable, displayable, transmittable representation of the
object, beginning with <code>[</code>&nbsp;<small>(left
bracket)</small> and ending with <code>]</code>
&nbsp;<small>(right bracket)</small>.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - if a called function fails</dd>
</dl>
</li>
</ul>
<a name="write-java.io.Writer-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/io/Writer.html?is-external=true" title="class or interface in java.io">Writer</a>&nbsp;write(<a href="https://docs.oracle.com/javase/7/docs/api/java/io/Writer.html?is-external=true" title="class or interface in java.io">Writer</a>&nbsp;writer)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Write the contents of the JSONArray as JSON text to a writer. For
compactness, no whitespace is added.
<p><b>
Warning: This method assumes that the data structure is acyclical.
</b></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>writer</code> - the writer object</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The writer.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - if a called function fails</dd>
</dl>
</li>
</ul>
<a name="write-java.io.Writer-int-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>write</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/io/Writer.html?is-external=true" title="class or interface in java.io">Writer</a>&nbsp;write(<a href="https://docs.oracle.com/javase/7/docs/api/java/io/Writer.html?is-external=true" title="class or interface in java.io">Writer</a>&nbsp;writer,
int&nbsp;indentFactor,
int&nbsp;indent)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Write the contents of the JSONArray as JSON text to a writer.
<p>If <pre><code> indentFactor &gt; 0</code></pre> and the <a href="../../org/json/JSONArray.html" title="class in org.json"><code>JSONArray</code></a> has only
one element, then the array will be output on a single line:
<pre><code> [1]</code></pre>
<p>If an array has 2 or more elements, then it will be output across
multiple lines: <pre><code>
[
1,
"value 2",
3
]
</code></pre>
<p><b>
Warning: This method assumes that the data structure is acyclical.
</b></div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>writer</code> - Writes the serialized JSON</dd>
<dd><code>indentFactor</code> - The number of spaces to add to each level of indentation.</dd>
<dd><code>indent</code> - The indentation of the top level.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The writer.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - if a called function fails or unable to write</dd>
</dl>
</li>
</ul>
<a name="toList--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toList</h4>
<pre>public&nbsp;<a href="https://docs.oracle.com/javase/7/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&gt;&nbsp;toList()</pre>
<div class="block">Returns a java.util.List containing all of the elements in this array.
If an element in the array is a JSONArray or JSONObject it will also
be converted to a List and a Map respectively.
<p>
Warning: This method assumes that the data structure is acyclical.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a java.util.List containing the elements of this array</dd>
</dl>
</li>
</ul>
<a name="isEmpty--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>isEmpty</h4>
<pre>public&nbsp;boolean&nbsp;isEmpty()</pre>
<div class="block">Check if JSONArray is empty.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if JSONArray is empty, otherwise false.</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../org/json/package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-all.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../org/json/HTTPTokener.html" title="class in org.json"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../org/json/JSONException.html" title="class in org.json"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?org/json/JSONArray.html" target="_top">Frames</a></li>
<li><a href="JSONArray.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>