mirror of
https://github.com/ethauvin/JSON-java.git
synced 2025-06-17 07:50:52 -07:00
1778 lines
73 KiB
HTML
1778 lines
73 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<!-- NewPage -->
|
|
<html lang="de">
|
|
<head>
|
|
<!-- Generated by javadoc (1.8.0_05) on Sun Feb 14 02:15:50 CET 2016 -->
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
<title>JSONArray (JSON in Java 20160212 API)</title>
|
|
<meta name="date" content="2016-02-14">
|
|
<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 (JSON in Java 20160212 API)";
|
|
}
|
|
}
|
|
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};
|
|
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="class-use/JSONArray.html">Use</a></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 Class</span></a></li>
|
|
<li><a href="../../org/json/JSONException.html" title="class in org.json"><span class="typeNameLink">Next 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 Frames</a></li>
|
|
</ul>
|
|
<ul class="navList" id="allclasses_navbar_top">
|
|
<li><a href="../../allclasses-noframe.html">All 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: </li>
|
|
<li>Nested | </li>
|
|
<li>Field | </li>
|
|
<li><a href="#constructor.summary">Constr</a> | </li>
|
|
<li><a href="#method.summary">Method</a></li>
|
|
</ul>
|
|
<ul class="subNavList">
|
|
<li>Detail: </li>
|
|
<li>Field | </li>
|
|
<li><a href="#constructor.detail">Constr</a> | </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>java.lang.Object</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>java.lang.Iterable<java.lang.Object></dd>
|
|
</dl>
|
|
<hr>
|
|
<br>
|
|
<pre>public class <span class="typeNameLabel">JSONArray</span>
|
|
extends java.lang.Object
|
|
implements java.lang.Iterable<java.lang.Object></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> <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>
|
|
<small>(comma)</small> elision.</li>
|
|
<li>Strings may be quoted with <code>'</code> <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>
|
|
<dl>
|
|
<dt><span class="simpleTagLabel">Version:</span></dt>
|
|
<dd>2016-02-08</dd>
|
|
<dt><span class="simpleTagLabel">Author:</span></dt>
|
|
<dd>JSON.org</dd>
|
|
</dl>
|
|
</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"> </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>(java.util.Collection<?> 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-org.json.JSONTokener-">JSONArray</a></span>(<a href="../../org/json/JSONTokener.html" title="class in org.json">JSONTokener</a> x)</code>
|
|
<div class="block">Construct a JSONArray from a JSONTokener.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colOne"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#JSONArray-java.lang.Object-">JSONArray</a></span>(java.lang.Object array)</code>
|
|
<div class="block">Construct a JSONArray from an array</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colOne"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#JSONArray-java.lang.String-">JSONArray</a></span>(java.lang.String 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"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </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>java.lang.Object</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#get-int-">get</a></span>(int 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>java.math.BigDecimal</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#getBigDecimal-int-">getBigDecimal</a></span>(int 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>java.math.BigInteger</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#getBigInteger-int-">getBigInteger</a></span>(int 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 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 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><E extends java.lang.Enum<E>><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>(java.lang.Class<E> clazz,
|
|
int 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>int</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#getInt-int-">getInt</a></span>(int index)</code>
|
|
<div class="block">Get the int value associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i7" 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#getJSONArray-int-">getJSONArray</a></span>(int index)</code>
|
|
<div class="block">Get the JSONArray associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i8" 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#getJSONObject-int-">getJSONObject</a></span>(int index)</code>
|
|
<div class="block">Get the JSONObject associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i9" class="rowColor">
|
|
<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 index)</code>
|
|
<div class="block">Get the long value associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i10" class="altColor">
|
|
<td class="colFirst"><code>java.lang.String</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#getString-int-">getString</a></span>(int index)</code>
|
|
<div class="block">Get the string associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i11" class="rowColor">
|
|
<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 index)</code>
|
|
<div class="block">Determine if the value is null.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i12" class="altColor">
|
|
<td class="colFirst"><code>java.util.Iterator<java.lang.Object></code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#iterator--">iterator</a></span>()</code> </td>
|
|
</tr>
|
|
<tr id="i13" class="rowColor">
|
|
<td class="colFirst"><code>java.lang.String</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#join-java.lang.String-">join</a></span>(java.lang.String separator)</code>
|
|
<div class="block">Make a string from the contents of this JSONArray.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i14" class="altColor">
|
|
<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="i15" class="rowColor">
|
|
<td class="colFirst"><code>java.lang.Object</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#opt-int-">opt</a></span>(int index)</code>
|
|
<div class="block">Get the optional object value associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i16" class="altColor">
|
|
<td class="colFirst"><code>java.math.BigDecimal</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#optBigDecimal-int-java.math.BigDecimal-">optBigDecimal</a></span>(int index,
|
|
java.math.BigDecimal defaultValue)</code>
|
|
<div class="block">Get the optional BigDecimal value associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i17" class="rowColor">
|
|
<td class="colFirst"><code>java.math.BigInteger</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#optBigInteger-int-java.math.BigInteger-">optBigInteger</a></span>(int index,
|
|
java.math.BigInteger defaultValue)</code>
|
|
<div class="block">Get the optional BigInteger value associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i18" class="altColor">
|
|
<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 index)</code>
|
|
<div class="block">Get the optional boolean value associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i19" class="rowColor">
|
|
<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 index,
|
|
boolean defaultValue)</code>
|
|
<div class="block">Get the optional boolean value associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i20" class="altColor">
|
|
<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 index)</code>
|
|
<div class="block">Get the optional double value associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i21" class="rowColor">
|
|
<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 index,
|
|
double defaultValue)</code>
|
|
<div class="block">Get the optional double value associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i22" class="altColor">
|
|
<td class="colFirst"><code><E extends java.lang.Enum<E>><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>(java.lang.Class<E> clazz,
|
|
int index)</code>
|
|
<div class="block">Get the enum value associated with a key.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i23" class="rowColor">
|
|
<td class="colFirst"><code><E extends java.lang.Enum<E>><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>(java.lang.Class<E> clazz,
|
|
int index,
|
|
E defaultValue)</code>
|
|
<div class="block">Get the enum value associated with a key.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i24" class="altColor">
|
|
<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 index)</code>
|
|
<div class="block">Get the optional int value associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i25" class="rowColor">
|
|
<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 index,
|
|
int defaultValue)</code>
|
|
<div class="block">Get the optional int value associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i26" 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#optJSONArray-int-">optJSONArray</a></span>(int index)</code>
|
|
<div class="block">Get the optional JSONArray associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i27" 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#optJSONObject-int-">optJSONObject</a></span>(int index)</code>
|
|
<div class="block">Get the optional JSONObject associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i28" class="altColor">
|
|
<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 index)</code>
|
|
<div class="block">Get the optional long value associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i29" class="rowColor">
|
|
<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 index,
|
|
long defaultValue)</code>
|
|
<div class="block">Get the optional long value associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i30" class="altColor">
|
|
<td class="colFirst"><code>java.lang.String</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#optString-int-">optString</a></span>(int index)</code>
|
|
<div class="block">Get the optional string value associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i31" class="rowColor">
|
|
<td class="colFirst"><code>java.lang.String</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#optString-int-java.lang.String-">optString</a></span>(int index,
|
|
java.lang.String defaultValue)</code>
|
|
<div class="block">Get the optional string associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i32" 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-boolean-">put</a></span>(boolean value)</code>
|
|
<div class="block">Append a boolean value.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i33" 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.Collection-">put</a></span>(java.util.Collection<?> 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="i34" 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-double-">put</a></span>(double value)</code>
|
|
<div class="block">Append a double value.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i35" 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 value)</code>
|
|
<div class="block">Append an int value.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i36" 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 index,
|
|
boolean value)</code>
|
|
<div class="block">Put or replace a boolean value in the JSONArray.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i37" 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 index,
|
|
java.util.Collection<?> 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="i38" 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 index,
|
|
double value)</code>
|
|
<div class="block">Put or replace a double value.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i39" 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-int-">put</a></span>(int index,
|
|
int value)</code>
|
|
<div class="block">Put or replace an int value.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i40" 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-long-">put</a></span>(int index,
|
|
long value)</code>
|
|
<div class="block">Put or replace a long value.</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-int-java.util.Map-">put</a></span>(int index,
|
|
java.util.Map<?,?> 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="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-int-java.lang.Object-">put</a></span>(int index,
|
|
java.lang.Object value)</code>
|
|
<div class="block">Put or replace an object value in the JSONArray.</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-long-">put</a></span>(long value)</code>
|
|
<div class="block">Append an long 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-java.util.Map-">put</a></span>(java.util.Map<?,?> 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="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-java.lang.Object-">put</a></span>(java.lang.Object value)</code>
|
|
<div class="block">Append an object value.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i46" class="altColor">
|
|
<td class="colFirst"><code>java.lang.Object</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#remove-int-">remove</a></span>(int index)</code>
|
|
<div class="block">Remove an index and close the hole.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i47" class="rowColor">
|
|
<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>(java.lang.Object other)</code>
|
|
<div class="block">Determine if two JSONArrays are similar.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i48" 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#toJSONObject-org.json.JSONArray-">toJSONObject</a></span>(<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a> 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="i49" class="rowColor">
|
|
<td class="colFirst"><code>java.lang.String</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="i50" class="altColor">
|
|
<td class="colFirst"><code>java.lang.String</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#toString-int-">toString</a></span>(int indentFactor)</code>
|
|
<div class="block">Make a prettyprinted JSON text of this JSONArray.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i51" class="rowColor">
|
|
<td class="colFirst"><code>java.io.Writer</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#write-java.io.Writer-">write</a></span>(java.io.Writer writer)</code>
|
|
<div class="block">Write the contents of the JSONArray as JSON text to a writer.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i52" class="altColor">
|
|
<td class="colFirst"><code>java.io.Writer</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONArray.html#write-java.io.Writer-int-int-">write</a></span>(java.io.Writer writer,
|
|
int indentFactor,
|
|
int 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 java.lang.Object</h3>
|
|
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li>
|
|
</ul>
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Iterable">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Methods inherited from interface java.lang.Iterable</h3>
|
|
<code>forEach, spliterator</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 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 JSONArray(<a href="../../org/json/JSONTokener.html" title="class in org.json">JSONTokener</a> 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 JSONArray(java.lang.String 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> <small>(left
|
|
bracket)</small> and ends with <code>]</code>
|
|
<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 JSONArray(java.util.Collection<?> 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.Object-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>JSONArray</h4>
|
|
<pre>public JSONArray(java.lang.Object 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="throwsLabel">Throws:</span></dt>
|
|
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If not an array.</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 java.util.Iterator<java.lang.Object> iterator()</pre>
|
|
<dl>
|
|
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
|
|
<dd><code>iterator</code> in interface <code>java.lang.Iterable<java.lang.Object></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="get-int-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>get</h4>
|
|
<pre>public java.lang.Object get(int 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 boolean getBoolean(int 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 double getDouble(int 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="getEnum-java.lang.Class-int-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getEnum</h4>
|
|
<pre>public <E extends java.lang.Enum<E>> E getEnum(java.lang.Class<E> clazz,
|
|
int 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">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 java.math.BigDecimal getBigDecimal(int 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.</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 java.math.BigInteger getBigInteger(int 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 int getInt(int 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 <a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a> getJSONArray(int 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 <a href="../../org/json/JSONObject.html" title="class in org.json">JSONObject</a> getJSONObject(int 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 long getLong(int 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 java.lang.String getString(int 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 boolean isNull(int index)</pre>
|
|
<div class="block">Determine if the value is null.</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 null, 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 java.lang.String join(java.lang.String 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 int 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 java.lang.Object opt(int 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.</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 boolean optBoolean(int 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 boolean optBoolean(int index,
|
|
boolean 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 double optDouble(int 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 double optDouble(int index,
|
|
double 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="optInt-int-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>optInt</h4>
|
|
<pre>public int optInt(int 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 int optInt(int index,
|
|
int 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 <E extends java.lang.Enum<E>> E optEnum(java.lang.Class<E> clazz,
|
|
int index)</pre>
|
|
<div class="block">Get the enum value associated with a key.</div>
|
|
<dl>
|
|
<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 <E extends java.lang.Enum<E>> E optEnum(java.lang.Class<E> clazz,
|
|
int index,
|
|
E defaultValue)</pre>
|
|
<div class="block">Get the enum value associated with a key.</div>
|
|
<dl>
|
|
<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 java.math.BigInteger optBigInteger(int index,
|
|
java.math.BigInteger 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 java.math.BigDecimal optBigDecimal(int index,
|
|
java.math.BigDecimal 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.</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 <a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a> optJSONArray(int 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 <a href="../../org/json/JSONObject.html" title="class in org.json">JSONObject</a> optJSONObject(int 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 long optLong(int 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 long optLong(int index,
|
|
long 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="optString-int-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>optString</h4>
|
|
<pre>public java.lang.String optString(int 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 coverted 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 java.lang.String optString(int index,
|
|
java.lang.String 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 <a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a> put(boolean 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 <a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a> put(java.util.Collection<?> 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>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="put-double-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>put</h4>
|
|
<pre>public <a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a> put(double 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-int-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>put</h4>
|
|
<pre>public <a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a> put(int 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 <a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a> put(long 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 <a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a> put(java.util.Map<?,?> 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>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="put-java.lang.Object-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>put</h4>
|
|
<pre>public <a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a> put(java.lang.Object 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>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="put-int-boolean-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>put</h4>
|
|
<pre>public <a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a> put(int index,
|
|
boolean 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 <a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a> put(int index,
|
|
java.util.Collection<?> 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 not finite.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="put-int-double-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>put</h4>
|
|
<pre>public <a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a> put(int index,
|
|
double 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 not finite.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="put-int-int-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>put</h4>
|
|
<pre>public <a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a> put(int index,
|
|
int 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 <a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a> put(int index,
|
|
long 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 <a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a> put(int index,
|
|
java.util.Map<?,?> 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>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="put-int-java.lang.Object-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>put</h4>
|
|
<pre>public <a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a> put(int index,
|
|
java.lang.Object 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="remove-int-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>remove</h4>
|
|
<pre>public java.lang.Object remove(int 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 boolean similar(java.lang.Object 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 <a href="../../org/json/JSONObject.html" title="class in org.json">JSONObject</a> toJSONObject(<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a> 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 java.lang.String 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>
|
|
Warning: This method assumes that the data structure is acyclical.</div>
|
|
<dl>
|
|
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
|
|
<dd><code>toString</code> in class <code>java.lang.Object</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 java.lang.String toString(int indentFactor)
|
|
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
|
|
<div class="block">Make a prettyprinted JSON text of this JSONArray. Warning: This method
|
|
assumes that the data structure is acyclical.</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> <small>(left
|
|
bracket)</small> and ending with <code>]</code>
|
|
<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></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="write-java.io.Writer-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>write</h4>
|
|
<pre>public java.io.Writer write(java.io.Writer 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>
|
|
Warning: This method assumes that the data structure is acyclical.</div>
|
|
<dl>
|
|
<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></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="write-java.io.Writer-int-int-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>write</h4>
|
|
<pre>public java.io.Writer write(java.io.Writer writer,
|
|
int indentFactor,
|
|
int 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. For
|
|
compactness, no whitespace is added.
|
|
<p>
|
|
Warning: This method assumes that the data structure is acyclical.</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 indention 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></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="class-use/JSONArray.html">Use</a></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 Class</span></a></li>
|
|
<li><a href="../../org/json/JSONException.html" title="class in org.json"><span class="typeNameLink">Next 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 Frames</a></li>
|
|
</ul>
|
|
<ul class="navList" id="allclasses_navbar_bottom">
|
|
<li><a href="../../allclasses-noframe.html">All 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: </li>
|
|
<li>Nested | </li>
|
|
<li>Field | </li>
|
|
<li><a href="#constructor.summary">Constr</a> | </li>
|
|
<li><a href="#method.summary">Method</a></li>
|
|
</ul>
|
|
<ul class="subNavList">
|
|
<li>Detail: </li>
|
|
<li>Field | </li>
|
|
<li><a href="#constructor.detail">Constr</a> | </li>
|
|
<li><a href="#method.detail">Method</a></li>
|
|
</ul>
|
|
</div>
|
|
<a name="skip.navbar.bottom">
|
|
<!-- -->
|
|
</a></div>
|
|
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
|
<p class="legalCopy"><small>Copyright © 2016. All Rights Reserved.</small></p>
|
|
</body>
|
|
</html>
|