mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-26 23:26:45 +01:00
1790 lines
78 KiB
HTML
1790 lines
78 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
|
<!-- NewPage -->
|
|
<html lang="sv">
|
|
<head>
|
|
<!-- Generated by javadoc (version 1.7.0_67) on Sun Nov 16 11:09:55 CET 2014 -->
|
|
<title>JSONArray</title>
|
|
<meta name="date" content="2014-11-16">
|
|
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
|
|
</head>
|
|
<body>
|
|
<script type="text/javascript"><!--
|
|
if (location.href.indexOf('is-external=true') == -1) {
|
|
parent.document.title = "JSONArray";
|
|
}
|
|
//-->
|
|
</script>
|
|
<noscript>
|
|
<div>JavaScript is disabled on your browser.</div>
|
|
</noscript>
|
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
|
<div class="topNav"><a name="navbar_top">
|
|
<!-- -->
|
|
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="navList" title="Navigation">
|
|
<li><a href="../../../overview-summary.html">Overview</a></li>
|
|
<li><a href="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-files/index-1.html">Index</a></li>
|
|
<li><a href="../../../help-doc.html">Help</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="subNav">
|
|
<ul class="navList">
|
|
<li><a href="../../../com/intellectualcrafters/json/HTTPTokener.html"
|
|
title="class in com.intellectualcrafters.json"><span class="strong">Prev Class</span></a></li>
|
|
<li><a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.json"><span class="strong">Next Class</span></a></li>
|
|
</ul>
|
|
<ul class="navList">
|
|
<li><a href="../../../index.html?com/intellectualcrafters/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">com.intellectualcrafters.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>com.intellectualcrafters.json.JSONArray</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<div class="description">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<hr>
|
|
<br>
|
|
<pre>public class <span class="strong">JSONArray</span>
|
|
extends 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>
|
|
</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="overviewSummary" 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><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#JSONArray()">JSONArray</a></strong>()</code>
|
|
|
|
<div class="block">Construct an empty JSONArray.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colOne"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#JSONArray(java.util.Collection)">JSONArray</a></strong>(java.util.Collection<java.lang.Object> collection)</code>
|
|
|
|
<div class="block">Construct a JSONArray from a Collection.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colOne"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#JSONArray(com.intellectualcrafters.json.JSONTokener)">JSONArray</a></strong>(<a
|
|
href="../../../com/intellectualcrafters/json/JSONTokener.html"
|
|
title="class in com.intellectualcrafters.json">JSONTokener</a> x)</code>
|
|
|
|
<div class="block">Construct a JSONArray from a JSONTokener.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colOne"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#JSONArray(java.lang.Object)">JSONArray</a></strong>(java.lang.Object array)</code>
|
|
|
|
<div class="block">Construct a JSONArray from an array</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colOne"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#JSONArray(java.lang.String)">JSONArray</a></strong>(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="overviewSummary" border="0" cellpadding="3" cellspacing="0"
|
|
summary="Method Summary table, listing methods, and an explanation">
|
|
<caption><span>Methods</span><span class="tabEnd"> </span></caption>
|
|
<tr>
|
|
<th class="colFirst" scope="col">Modifier and Type</th>
|
|
<th class="colLast" scope="col">Method and Description</th>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>java.lang.Object</code></td>
|
|
<td class="colLast"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#get(int)">get</a></strong>(int index)</code>
|
|
|
|
<div class="block">Get the object value associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>boolean</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../com/intellectualcrafters/json/JSONArray.html#getBoolean(int)">getBoolean</a></strong>(int index)</code>
|
|
|
|
<div class="block">Get the boolean value associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>double</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../com/intellectualcrafters/json/JSONArray.html#getDouble(int)">getDouble</a></strong>(int index)</code>
|
|
|
|
<div class="block">Get the double value associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>int</code></td>
|
|
<td class="colLast"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#getInt(int)">getInt</a></strong>(int index)</code>
|
|
|
|
<div class="block">Get the int value associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code><a href="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.json">JSONArray</a></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../com/intellectualcrafters/json/JSONArray.html#getJSONArray(int)">getJSONArray</a></strong>(int index)</code>
|
|
|
|
<div class="block">Get the JSONArray associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code><a href="../../../com/intellectualcrafters/json/JSONObject.html"
|
|
title="class in com.intellectualcrafters.json">JSONObject</a></code></td>
|
|
<td class="colLast"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#getJSONObject(int)">getJSONObject</a></strong>(int index)</code>
|
|
|
|
<div class="block">Get the JSONObject associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>long</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../com/intellectualcrafters/json/JSONArray.html#getLong(int)">getLong</a></strong>(int index)</code>
|
|
|
|
<div class="block">Get the long value associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>java.lang.String</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../com/intellectualcrafters/json/JSONArray.html#getString(int)">getString</a></strong>(int index)</code>
|
|
|
|
<div class="block">Get the string associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>boolean</code></td>
|
|
<td class="colLast"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#isNull(int)">isNull</a></strong>(int index)</code>
|
|
|
|
<div class="block">Determine if the value is null.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>java.lang.String</code></td>
|
|
<td class="colLast"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#join(java.lang.String)">join</a></strong>(java.lang.String separator)</code>
|
|
|
|
<div class="block">Make a string from the contents of this JSONArray.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>int</code></td>
|
|
<td class="colLast"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#length()">length</a></strong>()</code>
|
|
|
|
<div class="block">Get the number of elements in the JSONArray, included nulls.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>java.lang.Object</code></td>
|
|
<td class="colLast"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#opt(int)">opt</a></strong>(int index)</code>
|
|
|
|
<div class="block">Get the optional object value associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>boolean</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../com/intellectualcrafters/json/JSONArray.html#optBoolean(int)">optBoolean</a></strong>(int index)</code>
|
|
|
|
<div class="block">Get the optional boolean value associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>boolean</code></td>
|
|
<td class="colLast"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#optBoolean(int,%20boolean)">optBoolean</a></strong>(int index,
|
|
boolean defaultValue)</code>
|
|
|
|
<div class="block">Get the optional boolean value associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>double</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../com/intellectualcrafters/json/JSONArray.html#optDouble(int)">optDouble</a></strong>(int index)</code>
|
|
|
|
<div class="block">Get the optional double value associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>double</code></td>
|
|
<td class="colLast"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#optDouble(int,%20double)">optDouble</a></strong>(int index,
|
|
double defaultValue)</code>
|
|
|
|
<div class="block">Get the optional double value associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>int</code></td>
|
|
<td class="colLast"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#optInt(int)">optInt</a></strong>(int index)</code>
|
|
|
|
<div class="block">Get the optional int value associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>int</code></td>
|
|
<td class="colLast"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#optInt(int,%20int)">optInt</a></strong>(int index,
|
|
int defaultValue)</code>
|
|
|
|
<div class="block">Get the optional int value associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code><a href="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.json">JSONArray</a></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../com/intellectualcrafters/json/JSONArray.html#optJSONArray(int)">optJSONArray</a></strong>(int index)</code>
|
|
|
|
<div class="block">Get the optional JSONArray associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code><a href="../../../com/intellectualcrafters/json/JSONObject.html"
|
|
title="class in com.intellectualcrafters.json">JSONObject</a></code></td>
|
|
<td class="colLast"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#optJSONObject(int)">optJSONObject</a></strong>(int index)</code>
|
|
|
|
<div class="block">Get the optional JSONObject associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>long</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../com/intellectualcrafters/json/JSONArray.html#optLong(int)">optLong</a></strong>(int index)</code>
|
|
|
|
<div class="block">Get the optional long value associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>long</code></td>
|
|
<td class="colLast"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#optLong(int,%20long)">optLong</a></strong>(int index,
|
|
long defaultValue)</code>
|
|
|
|
<div class="block">Get the optional long value associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>java.lang.String</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../com/intellectualcrafters/json/JSONArray.html#optString(int)">optString</a></strong>(int index)</code>
|
|
|
|
<div class="block">Get the optional string value associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>java.lang.String</code></td>
|
|
<td class="colLast"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#optString(int,%20java.lang.String)">optString</a></strong>(int index,
|
|
java.lang.String defaultValue)</code>
|
|
|
|
<div class="block">Get the optional string associated with an index.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code><a href="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.json">JSONArray</a></code></td>
|
|
<td class="colLast"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#put(boolean)">put</a></strong>(boolean value)</code>
|
|
|
|
<div class="block">Append a boolean value.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code><a href="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.json">JSONArray</a></code></td>
|
|
<td class="colLast"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#put(java.util.Collection)">put</a></strong>(java.util.Collection<java.lang.Object> 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 class="altColor">
|
|
<td class="colFirst"><code><a href="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.json">JSONArray</a></code></td>
|
|
<td class="colLast"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#put(double)">put</a></strong>(double value)</code>
|
|
|
|
<div class="block">Append a double value.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code><a href="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.json">JSONArray</a></code></td>
|
|
<td class="colLast"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#put(int)">put</a></strong>(int value)</code>
|
|
|
|
<div class="block">Append an int value.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code><a href="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.json">JSONArray</a></code></td>
|
|
<td class="colLast"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#put(int,%20boolean)">put</a></strong>(int index,
|
|
boolean value)</code>
|
|
|
|
<div class="block">Put or replace a boolean value in the JSONArray.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code><a href="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.json">JSONArray</a></code></td>
|
|
<td class="colLast"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#put(int,%20java.util.Collection)">put</a></strong>(int index,
|
|
java.util.Collection<java.lang.Object> 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 class="altColor">
|
|
<td class="colFirst"><code><a href="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.json">JSONArray</a></code></td>
|
|
<td class="colLast"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#put(int,%20double)">put</a></strong>(int index,
|
|
double value)</code>
|
|
|
|
<div class="block">Put or replace a double value.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code><a href="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.json">JSONArray</a></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../com/intellectualcrafters/json/JSONArray.html#put(int,%20int)">put</a></strong>(int index,
|
|
int value)</code>
|
|
|
|
<div class="block">Put or replace an int value.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code><a href="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.json">JSONArray</a></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../com/intellectualcrafters/json/JSONArray.html#put(int,%20long)">put</a></strong>(int index,
|
|
long value)</code>
|
|
|
|
<div class="block">Put or replace a long value.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code><a href="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.json">JSONArray</a></code></td>
|
|
<td class="colLast"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#put(int,%20java.util.Map)">put</a></strong>(int index,
|
|
java.util.Map<java.lang.String,java.lang.Object> 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 class="altColor">
|
|
<td class="colFirst"><code><a href="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.json">JSONArray</a></code></td>
|
|
<td class="colLast"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#put(int,%20java.lang.Object)">put</a></strong>(int index,
|
|
java.lang.Object value)</code>
|
|
|
|
<div class="block">Put or replace an object value in the JSONArray.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code><a href="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.json">JSONArray</a></code></td>
|
|
<td class="colLast"><code><strong><a href="../../../com/intellectualcrafters/json/JSONArray.html#put(long)">put</a></strong>(long value)</code>
|
|
|
|
<div class="block">Append an long value.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code><a href="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.json">JSONArray</a></code></td>
|
|
<td class="colLast"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#put(java.util.Map)">put</a></strong>(java.util.Map<java.lang.String,java.lang.Object> 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 class="rowColor">
|
|
<td class="colFirst"><code><a href="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.json">JSONArray</a></code></td>
|
|
<td class="colLast"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#put(java.lang.Object)">put</a></strong>(java.lang.Object value)</code>
|
|
|
|
<div class="block">Append an object value.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>java.lang.Object</code></td>
|
|
<td class="colLast"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#remove(int)">remove</a></strong>(int index)</code>
|
|
|
|
<div class="block">Remove an index and close the hole.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>boolean</code></td>
|
|
<td class="colLast"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#similar(java.lang.Object)">similar</a></strong>(java.lang.Object other)</code>
|
|
|
|
<div class="block">Determine if two JSONArrays are similar.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code><a href="../../../com/intellectualcrafters/json/JSONObject.html"
|
|
title="class in com.intellectualcrafters.json">JSONObject</a></code></td>
|
|
<td class="colLast"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#toJSONObject(com.intellectualcrafters.json.JSONArray)">toJSONObject</a></strong>(<a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html" title="class in com.intellectualcrafters.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 class="rowColor">
|
|
<td class="colFirst"><code>java.lang.String</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../com/intellectualcrafters/json/JSONArray.html#toString()">toString</a></strong>()</code>
|
|
|
|
<div class="block">Make a JSON text of this JSONArray.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>java.lang.String</code></td>
|
|
<td class="colLast"><code><strong><a href="../../../com/intellectualcrafters/json/JSONArray.html#toString(int)">toString</a></strong>(int indentFactor)</code>
|
|
|
|
<div class="block">Make a prettyprinted JSON text of this JSONArray.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>java.io.Writer</code></td>
|
|
<td class="colLast"><code><strong><a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html#write(java.io.Writer)">write</a></strong>(java.io.Writer writer)</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>
|
|
</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(com.intellectualcrafters.json.JSONTokener)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>JSONArray</h4>
|
|
<pre>public JSONArray(<a href="../../../com/intellectualcrafters/json/JSONTokener.html"
|
|
title="class in com.intellectualcrafters.json">JSONTokener</a> x)
|
|
throws <a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.json">JSONException</a></pre>
|
|
<div class="block">Construct a JSONArray from a JSONTokener.</div>
|
|
<dl>
|
|
<dt><span class="strong">Parameters:</span></dt>
|
|
<dd><code>x</code> - A JSONTokener</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.json">JSONException</a></pre>
|
|
<div class="block">Construct a JSONArray from a source JSON text.</div>
|
|
<dl>
|
|
<dt><span class="strong">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="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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<java.lang.Object> collection)</pre>
|
|
<div class="block">Construct a JSONArray from a Collection.</div>
|
|
<dl>
|
|
<dt><span class="strong">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="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.json">JSONException</a></pre>
|
|
<div class="block">Construct a JSONArray from an array</div>
|
|
<dl>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="get(int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>get</h4>
|
|
<pre>public java.lang.Object get(int index)
|
|
throws <a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.json">JSONException</a></pre>
|
|
<div class="block">Get the object value associated with an index.</div>
|
|
<dl>
|
|
<dt><span class="strong">Parameters:</span></dt>
|
|
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
|
|
<dt><span class="strong">Returns:</span></dt>
|
|
<dd>An object value.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="strong">Parameters:</span></dt>
|
|
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
|
|
<dt><span class="strong">Returns:</span></dt>
|
|
<dd>The truth.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.json">JSONException</a></pre>
|
|
<div class="block">Get the double value associated with an index.</div>
|
|
<dl>
|
|
<dt><span class="strong">Parameters:</span></dt>
|
|
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
|
|
<dt><span class="strong">Returns:</span></dt>
|
|
<dd>The value.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="getInt(int)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getInt</h4>
|
|
<pre>public int getInt(int index)
|
|
throws <a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.json">JSONException</a></pre>
|
|
<div class="block">Get the int value associated with an index.</div>
|
|
<dl>
|
|
<dt><span class="strong">Parameters:</span></dt>
|
|
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
|
|
<dt><span class="strong">Returns:</span></dt>
|
|
<dd>The value.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.json">JSONArray</a> getJSONArray(int index)
|
|
throws <a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.json">JSONException</a></pre>
|
|
<div class="block">Get the JSONArray associated with an index.</div>
|
|
<dl>
|
|
<dt><span class="strong">Parameters:</span></dt>
|
|
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
|
|
<dt><span class="strong">Returns:</span></dt>
|
|
<dd>A JSONArray value.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="../../../com/intellectualcrafters/json/JSONObject.html"
|
|
title="class in com.intellectualcrafters.json">JSONObject</a> getJSONObject(int index)
|
|
throws <a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.json">JSONException</a></pre>
|
|
<div class="block">Get the JSONObject associated with an index.</div>
|
|
<dl>
|
|
<dt><span class="strong">Parameters:</span></dt>
|
|
<dd><code>index</code> - subscript</dd>
|
|
<dt><span class="strong">Returns:</span></dt>
|
|
<dd>A JSONObject value.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.json">JSONException</a></pre>
|
|
<div class="block">Get the long value associated with an index.</div>
|
|
<dl>
|
|
<dt><span class="strong">Parameters:</span></dt>
|
|
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
|
|
<dt><span class="strong">Returns:</span></dt>
|
|
<dd>The value.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.json">JSONException</a></pre>
|
|
<div class="block">Get the string associated with an index.</div>
|
|
<dl>
|
|
<dt><span class="strong">Parameters:</span></dt>
|
|
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
|
|
<dt><span class="strong">Returns:</span></dt>
|
|
<dd>A string value.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="strong">Parameters:</span></dt>
|
|
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
|
|
<dt><span class="strong">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="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="strong">Parameters:</span></dt>
|
|
<dd><code>separator</code> - A string that will be inserted between the elements.</dd>
|
|
<dt><span class="strong">Returns:</span></dt>
|
|
<dd>a string.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="strong">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="strong">Parameters:</span></dt>
|
|
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
|
|
<dt><span class="strong">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="strong">Parameters:</span></dt>
|
|
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
|
|
<dt><span class="strong">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="strong">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="strong">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="strong">Parameters:</span></dt>
|
|
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
|
|
<dt><span class="strong">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="strong">Parameters:</span></dt>
|
|
<dd><code>index</code> - subscript</dd>
|
|
<dd><code>defaultValue</code> - The default value.</dd>
|
|
<dt><span class="strong">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="strong">Parameters:</span></dt>
|
|
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
|
|
<dt><span class="strong">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="strong">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="strong">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="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.json">JSONArray</a> optJSONArray(int index)</pre>
|
|
<div class="block">Get the optional JSONArray associated with an index.</div>
|
|
<dl>
|
|
<dt><span class="strong">Parameters:</span></dt>
|
|
<dd><code>index</code> - subscript</dd>
|
|
<dt><span class="strong">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="../../../com/intellectualcrafters/json/JSONObject.html"
|
|
title="class in com.intellectualcrafters.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="strong">Parameters:</span></dt>
|
|
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
|
|
<dt><span class="strong">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="strong">Parameters:</span></dt>
|
|
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
|
|
<dt><span class="strong">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="strong">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="strong">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="strong">Parameters:</span></dt>
|
|
<dd><code>index</code> - The index must be between 0 and length() - 1.</dd>
|
|
<dt><span class="strong">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="strong">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="strong">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="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.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="strong">Parameters:</span></dt>
|
|
<dd><code>value</code> - A boolean value.</dd>
|
|
<dt><span class="strong">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="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.json">JSONArray</a> put(java.util.Collection<java.lang.Object> 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="strong">Parameters:</span></dt>
|
|
<dd><code>value</code> - A Collection value.</dd>
|
|
<dt><span class="strong">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="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.json">JSONArray</a> put(double value)
|
|
throws <a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.json">JSONException</a></pre>
|
|
<div class="block">Append a double value. This increases the array's length by one.</div>
|
|
<dl>
|
|
<dt><span class="strong">Parameters:</span></dt>
|
|
<dd><code>value</code> - A double value.</dd>
|
|
<dt><span class="strong">Returns:</span></dt>
|
|
<dd>this.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.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="strong">Parameters:</span></dt>
|
|
<dd><code>value</code> - An int value.</dd>
|
|
<dt><span class="strong">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="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.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="strong">Parameters:</span></dt>
|
|
<dd><code>value</code> - A long value.</dd>
|
|
<dt><span class="strong">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="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.json">JSONArray</a> put(java.util.Map<java.lang.String,java.lang.Object> 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="strong">Parameters:</span></dt>
|
|
<dd><code>value</code> - A Map value.</dd>
|
|
<dt><span class="strong">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="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.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="strong">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="strong">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="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.json">JSONArray</a> put(int index,
|
|
boolean value)
|
|
throws <a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="strong">Parameters:</span></dt>
|
|
<dd><code>index</code> - The subscript.</dd>
|
|
<dd><code>value</code> - A boolean value.</dd>
|
|
<dt><span class="strong">Returns:</span></dt>
|
|
<dd>this.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.json">JSONArray</a> put(int index,
|
|
java.util.Collection<java.lang.Object> value)
|
|
throws <a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="strong">Parameters:</span></dt>
|
|
<dd><code>index</code> - The subscript.</dd>
|
|
<dd><code>value</code> - A Collection value.</dd>
|
|
<dt><span class="strong">Returns:</span></dt>
|
|
<dd>this.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.json">JSONArray</a> put(int index,
|
|
double value)
|
|
throws <a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="strong">Parameters:</span></dt>
|
|
<dd><code>index</code> - The subscript.</dd>
|
|
<dd><code>value</code> - A double value.</dd>
|
|
<dt><span class="strong">Returns:</span></dt>
|
|
<dd>this.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.json">JSONArray</a> put(int index,
|
|
int value)
|
|
throws <a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="strong">Parameters:</span></dt>
|
|
<dd><code>index</code> - The subscript.</dd>
|
|
<dd><code>value</code> - An int value.</dd>
|
|
<dt><span class="strong">Returns:</span></dt>
|
|
<dd>this.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.json">JSONArray</a> put(int index,
|
|
long value)
|
|
throws <a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="strong">Parameters:</span></dt>
|
|
<dd><code>index</code> - The subscript.</dd>
|
|
<dd><code>value</code> - A long value.</dd>
|
|
<dt><span class="strong">Returns:</span></dt>
|
|
<dd>this.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.json">JSONArray</a> put(int index,
|
|
java.util.Map<java.lang.String,java.lang.Object> value)
|
|
throws <a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="strong">Parameters:</span></dt>
|
|
<dd><code>index</code> - The subscript.</dd>
|
|
<dd><code>value</code> - The Map value.</dd>
|
|
<dt><span class="strong">Returns:</span></dt>
|
|
<dd>this.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="../../../com/intellectualcrafters/json/JSONArray.html"
|
|
title="class in com.intellectualcrafters.json">JSONArray</a> put(int index,
|
|
java.lang.Object value)
|
|
throws <a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="strong">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="strong">Returns:</span></dt>
|
|
<dd>this.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="strong">Parameters:</span></dt>
|
|
<dd><code>index</code> - The index of the element to be removed.</dd>
|
|
<dt><span class="strong">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="strong">Parameters:</span></dt>
|
|
<dd><code>other</code> - The other JSONArray</dd>
|
|
<dt><span class="strong">Returns:</span></dt>
|
|
<dd>true if they are equal</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="toJSONObject(com.intellectualcrafters.json.JSONArray)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>toJSONObject</h4>
|
|
<pre>public <a href="../../../com/intellectualcrafters/json/JSONObject.html"
|
|
title="class in com.intellectualcrafters.json">JSONObject</a> toJSONObject(<a
|
|
href="../../../com/intellectualcrafters/json/JSONArray.html" title="class in com.intellectualcrafters.json">JSONArray</a> names)
|
|
throws <a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="strong">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="strong">Returns:</span></dt>
|
|
<dd>A JSONObject, or null if there are no names or if this JSONArray
|
|
has no values.
|
|
</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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><strong>Overrides:</strong></dt>
|
|
<dd><code>toString</code> in class <code>java.lang.Object</code></dd>
|
|
<dt><span class="strong">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="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="strong">Parameters:</span></dt>
|
|
<dd><code>indentFactor</code> - The number of spaces to add to each level of indentation.</dd>
|
|
<dt><span class="strong">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="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.json">JSONException</a></code></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="write(java.io.Writer)">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>write</h4>
|
|
<pre>public java.io.Writer write(java.io.Writer writer)
|
|
throws <a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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="strong">Returns:</span></dt>
|
|
<dd>The writer.</dd>
|
|
<dt><span class="strong">Throws:</span></dt>
|
|
<dd><code><a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.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><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="navList" title="Navigation">
|
|
<li><a href="../../../overview-summary.html">Overview</a></li>
|
|
<li><a href="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-files/index-1.html">Index</a></li>
|
|
<li><a href="../../../help-doc.html">Help</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="subNav">
|
|
<ul class="navList">
|
|
<li><a href="../../../com/intellectualcrafters/json/HTTPTokener.html"
|
|
title="class in com.intellectualcrafters.json"><span class="strong">Prev Class</span></a></li>
|
|
<li><a href="../../../com/intellectualcrafters/json/JSONException.html"
|
|
title="class in com.intellectualcrafters.json"><span class="strong">Next Class</span></a></li>
|
|
</ul>
|
|
<ul class="navList">
|
|
<li><a href="../../../index.html?com/intellectualcrafters/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 ======= -->
|
|
</body>
|
|
</html>
|