blob: a2c3702dd013fec366974eb661a0826fa745cc1d [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (9.0.1) on Fri Dec 28 04:30:56 EST 2018 -->
<title>JsonArray (JSR 374 (JSON Processing) Default Provider 1.1.5 API)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="date" content="2018-12-28">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../script.js"></script>
<script type="text/javascript" src="../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../jquery/jquery-1.10.2.js"></script>
<script type="text/javascript" src="../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="JsonArray (JSR 374 (JSON Processing) Default Provider 1.1.5 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6,"i9":6,"i10":6,"i11":18,"i12":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],16:["t5","Default Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../";loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="fixedNav">
<!-- ========= 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="../../overview-summary.html">Overview</a></li>
<li><a href="../../java.json-summary.html">Module</a></li>
<li><a href="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="../../javax/json/Json.html" title="class in javax.json"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../javax/json/JsonArrayBuilder.html" title="interface in javax.json"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?javax/json/JsonArray.html" target="_top">Frames</a></li>
<li><a href="JsonArray.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<ul class="navListSearch">
<li><span>SEARCH:&nbsp;</span>
<input type="text" id="search" value=" " disabled="disabled">
<input type="reset" id="reset" value=" " disabled="disabled">
</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>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle"><span class="moduleLabelInType">Module</span>&nbsp;<a href="../../java.json-summary.html">java.json</a></div>
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="../../javax/json/package-summary.html">javax.json</a></div>
<h2 title="Interface JsonArray" class="title">Interface JsonArray</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Superinterfaces:</dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a>&lt;<a href="../../javax/json/JsonValue.html" title="interface in javax.json">JsonValue</a>&gt;</code>, <code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a>&lt;<a href="../../javax/json/JsonValue.html" title="interface in javax.json">JsonValue</a>&gt;</code>, <code><a href="../../javax/json/JsonStructure.html" title="interface in javax.json">JsonStructure</a></code>, <code><a href="../../javax/json/JsonValue.html" title="interface in javax.json">JsonValue</a></code>, <code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../javax/json/JsonValue.html" title="interface in javax.json">JsonValue</a>&gt;</code></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="typeNameLabel">JsonArray</span>
extends <a href="../../javax/json/JsonStructure.html" title="interface in javax.json">JsonStructure</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../javax/json/JsonValue.html" title="interface in javax.json">JsonValue</a>&gt;</pre>
<div class="block"><code>JsonArray</code> represents an immutable JSON array
(an ordered sequence of zero or more values).
It also provides an unmodifiable list view of the values in the array.
<p>A <code>JsonArray</code> object can be created by reading JSON data from
an input source or it can be built from scratch using an array builder
object.
<p>The following example demonstrates how to create a <code>JsonArray</code>
object from an input source using the method <a href="../../javax/json/JsonReader.html#readArray--"><code>JsonReader.readArray()</code></a>:
<pre><code>
JsonReader jsonReader = Json.createReader(...);
JsonArray array = jsonReader.readArray();
jsonReader.close();
</code></pre>
<p>The following example demonstrates how to build an empty JSON array
using the class <a href="../../javax/json/JsonArrayBuilder.html" title="interface in javax.json"><code>JsonArrayBuilder</code></a>:
<pre><code>
JsonArray array = Json.createArrayBuilder().build();
</code></pre>
<p>The example code below demonstrates how to create the following JSON array:
<pre><code>
[
{ "type": "home", "number": "212 555-1234" },
{ "type": "fax", "number": "646 555-4567" }
]
</code></pre>
<pre><code>
JsonArray value = Json.createArrayBuilder()
.add(Json.createObjectBuilder()
.add("type", "home")
.add("number", "212 555-1234"))
.add(Json.createObjectBuilder()
.add("type", "fax")
.add("number", "646 555-4567"))
.build();
</code></pre>
<p>The following example demonstrates how to write a <code>JsonArray</code> object
as JSON data:
<pre><code>
JsonArray arr = ...;
JsonWriter writer = Json.createWriter(...)
writer.writeArray(arr);
writer.close();
</code></pre>
<p>The values in a <code>JsonArray</code> can be of the following types:
<a href="../../javax/json/JsonObject.html" title="interface in javax.json"><code>JsonObject</code></a>, <a href="../../javax/json/JsonArray.html" title="interface in javax.json"><code>JsonArray</code></a>,
<a href="../../javax/json/JsonString.html" title="interface in javax.json"><code>JsonString</code></a>, <a href="../../javax/json/JsonNumber.html" title="interface in javax.json"><code>JsonNumber</code></a>, <a href="../../javax/json/JsonValue.html#TRUE"><code>JsonValue.TRUE</code></a>,
<a href="../../javax/json/JsonValue.html#FALSE"><code>JsonValue.FALSE</code></a>, and <a href="../../javax/json/JsonValue.html#NULL"><code>JsonValue.NULL</code></a>.
<code>JsonArray</code> provides various accessor methods to access the values
in an array.
<p>The following example shows how to obtain the home phone number
"212 555-1234" from the array built in the previous example:
<pre><code>
JsonObject home = array.getJsonObject(0);
String number = home.getString("number");
</code></pre>
<p><code>JsonArray</code> instances are list objects that provide read-only
access to the values in the JSON array. Any attempt to modify the list,
whether directly or using its collection views, results in an
<code>UnsupportedOperationException</code>.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="nested.classes.inherited.from.class.javax.json.JsonValue">
<!-- -->
</a>
<h3>Nested classes/interfaces inherited from interface&nbsp;javax.json.<a href="../../javax/json/JsonValue.html" title="interface in javax.json">JsonValue</a></h3>
<code><a href="../../javax/json/JsonValue.ValueType.html" title="enum in javax.json">JsonValue.ValueType</a></code></li>
</ul>
</li>
</ul>
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="fields.inherited.from.class.javax.json.JsonValue">
<!-- -->
</a>
<h3>Fields inherited from interface&nbsp;javax.json.<a href="../../javax/json/JsonValue.html" title="interface in javax.json">JsonValue</a></h3>
<code><a href="../../javax/json/JsonValue.html#EMPTY_JSON_ARRAY">EMPTY_JSON_ARRAY</a>, <a href="../../javax/json/JsonValue.html#EMPTY_JSON_OBJECT">EMPTY_JSON_OBJECT</a>, <a href="../../javax/json/JsonValue.html#FALSE">FALSE</a>, <a href="../../javax/json/JsonValue.html#NULL">NULL</a>, <a href="../../javax/json/JsonValue.html#TRUE">TRUE</a></code></li>
</ul>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t5" class="tableTab"><span><a href="javascript:show(16);">Default Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javax/json/JsonArray.html#getBoolean-int-">getBoolean</a></span>&#8203;(int&nbsp;index)</code></th>
<td class="colLast">
<div class="block">Returns the boolean value at the specified position.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javax/json/JsonArray.html#getBoolean-int-boolean-">getBoolean</a></span>&#8203;(int&nbsp;index,
boolean&nbsp;defaultValue)</code></th>
<td class="colLast">
<div class="block">Returns the boolean value at the specified position.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javax/json/JsonArray.html#getInt-int-">getInt</a></span>&#8203;(int&nbsp;index)</code></th>
<td class="colLast">
<div class="block">A convenience method for
<code>getJsonNumber(index).intValue()</code>.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javax/json/JsonArray.html#getInt-int-int-">getInt</a></span>&#8203;(int&nbsp;index,
int&nbsp;defaultValue)</code></th>
<td class="colLast">
<div class="block">Returns the int value of the <code>JsonNumber</code> at the specified position.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../../javax/json/JsonArray.html" title="interface in javax.json">JsonArray</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javax/json/JsonArray.html#getJsonArray-int-">getJsonArray</a></span>&#8203;(int&nbsp;index)</code></th>
<td class="colLast">
<div class="block">Returns the array value at the specified position in this array.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code><a href="../../javax/json/JsonNumber.html" title="interface in javax.json">JsonNumber</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javax/json/JsonArray.html#getJsonNumber-int-">getJsonNumber</a></span>&#8203;(int&nbsp;index)</code></th>
<td class="colLast">
<div class="block">Returns the number value at the specified position in this array.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="../../javax/json/JsonObject.html" title="interface in javax.json">JsonObject</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javax/json/JsonArray.html#getJsonObject-int-">getJsonObject</a></span>&#8203;(int&nbsp;index)</code></th>
<td class="colLast">
<div class="block">Returns the object value at the specified position in this array.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code><a href="../../javax/json/JsonString.html" title="interface in javax.json">JsonString</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javax/json/JsonArray.html#getJsonString-int-">getJsonString</a></span>&#8203;(int&nbsp;index)</code></th>
<td class="colLast">
<div class="block">Returns the string value at ths specified position in this array.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javax/json/JsonArray.html#getString-int-">getString</a></span>&#8203;(int&nbsp;index)</code></th>
<td class="colLast">
<div class="block">A convenience method for
<code>getJsonString(index).getString()</code>.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javax/json/JsonArray.html#getString-int-java.lang.String-">getString</a></span>&#8203;(int&nbsp;index,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;defaultValue)</code></th>
<td class="colLast">
<div class="block">Returns the <code>String</code> value of <code>JsonString</code> at the specified
position in this JSON array values.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code>&lt;T extends <a href="../../javax/json/JsonValue.html" title="interface in javax.json">JsonValue</a>&gt;<br><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;T&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javax/json/JsonArray.html#getValuesAs-java.lang.Class-">getValuesAs</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;T&gt;&nbsp;clazz)</code></th>
<td class="colLast">
<div class="block">Returns a list view of the specified type for the array.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code>default &lt;T,K extends <a href="../../javax/json/JsonValue.html" title="interface in javax.json">JsonValue</a>&gt;<br><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;T&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javax/json/JsonArray.html#getValuesAs-java.util.function.Function-">getValuesAs</a></span>&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/Function.html?is-external=true" title="class or interface in java.util.function">Function</a>&lt;K,T&gt;&nbsp;func)</code></th>
<td class="colLast">
<div class="block">Returns a list view for the array.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../javax/json/JsonArray.html#isNull-int-">isNull</a></span>&#8203;(int&nbsp;index)</code></th>
<td class="colLast">
<div class="block">Returns <code>true</code> if the value at the specified location in this
array is <code>JsonValue.NULL</code>.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.util.Collection">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;java.util.<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#parallelStream--" title="class or interface in java.util">parallelStream</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#removeIf-java.util.function.Predicate-" title="class or interface in java.util">removeIf</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true#stream--" title="class or interface in java.util">stream</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Iterable">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html?is-external=true#forEach-java.util.function.Consumer-" title="class or interface in java.lang">forEach</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.javax.json.JsonStructure">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;javax.json.<a href="../../javax/json/JsonStructure.html" title="interface in javax.json">JsonStructure</a></h3>
<code><a href="../../javax/json/JsonStructure.html#getValue-java.lang.String-">getValue</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.javax.json.JsonValue">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;javax.json.<a href="../../javax/json/JsonValue.html" title="interface in javax.json">JsonValue</a></h3>
<code><a href="../../javax/json/JsonValue.html#asJsonArray--">asJsonArray</a>, <a href="../../javax/json/JsonValue.html#asJsonObject--">asJsonObject</a>, <a href="../../javax/json/JsonValue.html#getValueType--">getValueType</a>, <a href="../../javax/json/JsonValue.html#toString--">toString</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.util.List">
<!-- -->
</a>
<h3>Methods inherited from interface&nbsp;java.util.<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#add-int-E-" title="class or interface in java.util">add</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#add-E-" title="class or interface in java.util">add</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#addAll-int-java.util.Collection-" title="class or interface in java.util">addAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#addAll-java.util.Collection-" title="class or interface in java.util">addAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#clear--" title="class or interface in java.util">clear</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#contains-java.lang.Object-" title="class or interface in java.util">contains</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#containsAll-java.util.Collection-" title="class or interface in java.util">containsAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.util">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#get-int-" title="class or interface in java.util">get</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#hashCode--" title="class or interface in java.util">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#indexOf-java.lang.Object-" title="class or interface in java.util">indexOf</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#isEmpty--" title="class or interface in java.util">isEmpty</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#iterator--" title="class or interface in java.util">iterator</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#lastIndexOf-java.lang.Object-" title="class or interface in java.util">lastIndexOf</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#listIterator--" title="class or interface in java.util">listIterator</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#listIterator-int-" title="class or interface in java.util">listIterator</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#of--" title="class or interface in java.util">of</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#of-E-" title="class or interface in java.util">of</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#of-E...-" title="class or interface in java.util">of</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#of-E-E-" title="class or interface in java.util">of</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#of-E-E-E-" title="class or interface in java.util">of</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#of-E-E-E-E-" title="class or interface in java.util">of</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#of-E-E-E-E-E-" title="class or interface in java.util">of</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#of-E-E-E-E-E-E-" title="class or interface in java.util">of</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#of-E-E-E-E-E-E-E-" title="class or interface in java.util">of</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#of-E-E-E-E-E-E-E-E-" title="class or interface in java.util">of</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#of-E-E-E-E-E-E-E-E-E-" title="class or interface in java.util">of</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#of-E-E-E-E-E-E-E-E-E-E-" title="class or interface in java.util">of</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#remove-int-" title="class or interface in java.util">remove</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#remove-java.lang.Object-" title="class or interface in java.util">remove</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#removeAll-java.util.Collection-" title="class or interface in java.util">removeAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#replaceAll-java.util.function.UnaryOperator-" title="class or interface in java.util">replaceAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#retainAll-java.util.Collection-" title="class or interface in java.util">retainAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#set-int-E-" title="class or interface in java.util">set</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#size--" title="class or interface in java.util">size</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#sort-java.util.Comparator-" title="class or interface in java.util">sort</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#spliterator--" title="class or interface in java.util">spliterator</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#subList-int-int-" title="class or interface in java.util">subList</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#toArray--" title="class or interface in java.util">toArray</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true#toArray-T:A-" title="class or interface in java.util">toArray</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getJsonObject-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getJsonObject</h4>
<pre><a href="../../javax/json/JsonObject.html" title="interface in javax.json">JsonObject</a>&nbsp;getJsonObject&#8203;(int&nbsp;index)</pre>
<div class="block">Returns the object value at the specified position in this array.
This is a convenience method for <code>(JsonObject)get(index)</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - index of the value to be returned</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the value at the specified position in this array</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - if the index is out of range</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassCastException.html?is-external=true" title="class or interface in java.lang">ClassCastException</a></code> - if the value at the specified position is not
assignable to the JsonObject type</dd>
</dl>
</li>
</ul>
<a name="getJsonArray-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getJsonArray</h4>
<pre><a href="../../javax/json/JsonArray.html" title="interface in javax.json">JsonArray</a>&nbsp;getJsonArray&#8203;(int&nbsp;index)</pre>
<div class="block">Returns the array value at the specified position in this array.
This is a convenience method for <code>(JsonArray)get(index)</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - index of the value to be returned</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the value at the specified position in this array</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - if the index is out of range</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassCastException.html?is-external=true" title="class or interface in java.lang">ClassCastException</a></code> - if the value at the specified position is not
assignable to the JsonArray type</dd>
</dl>
</li>
</ul>
<a name="getJsonNumber-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getJsonNumber</h4>
<pre><a href="../../javax/json/JsonNumber.html" title="interface in javax.json">JsonNumber</a>&nbsp;getJsonNumber&#8203;(int&nbsp;index)</pre>
<div class="block">Returns the number value at the specified position in this array.
This is a convenience method for <code>(JsonNumber)get(index)</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - index of the value to be returned</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the value at the specified position in this array</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - if the index is out of range</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassCastException.html?is-external=true" title="class or interface in java.lang">ClassCastException</a></code> - if the value at the specified position is not
assignable to the JsonNumber type</dd>
</dl>
</li>
</ul>
<a name="getJsonString-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getJsonString</h4>
<pre><a href="../../javax/json/JsonString.html" title="interface in javax.json">JsonString</a>&nbsp;getJsonString&#8203;(int&nbsp;index)</pre>
<div class="block">Returns the string value at ths specified position in this array.
This is a convenience method for <code>(JsonString)get(index)</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - index of the value to be returned</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the value at the specified position in this array</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - if the index is out of range</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassCastException.html?is-external=true" title="class or interface in java.lang">ClassCastException</a></code> - if the value at the specified position is not
assignable to the JsonString type</dd>
</dl>
</li>
</ul>
<a name="getValuesAs-java.lang.Class-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getValuesAs</h4>
<pre>&lt;T extends <a href="../../javax/json/JsonValue.html" title="interface in javax.json">JsonValue</a>&gt;&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;T&gt;&nbsp;getValuesAs&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Class.html?is-external=true" title="class or interface in java.lang">Class</a>&lt;T&gt;&nbsp;clazz)</pre>
<div class="block">Returns a list view of the specified type for the array. This method
does not verify if there is a value of wrong type in the array. Providing
this typesafe view dynamically may cause a program fail with a
<code>ClassCastException</code>, if there is a value of wrong type in this
array. Unfortunately, the exception can occur at any time after this
method returns.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - The type of the List for the array</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>clazz</code> - a JsonValue type</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a list view of the specified type</dd>
</dl>
</li>
</ul>
<a name="getValuesAs-java.util.function.Function-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getValuesAs</h4>
<pre>default&nbsp;&lt;T,K extends <a href="../../javax/json/JsonValue.html" title="interface in javax.json">JsonValue</a>&gt;&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;T&gt;&nbsp;getValuesAs&#8203;(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/function/Function.html?is-external=true" title="class or interface in java.util.function">Function</a>&lt;K,T&gt;&nbsp;func)</pre>
<div class="block">Returns a list view for the array. The value and the type of the elements
in the list is specified by the <code>func</code> argument.
<p>This method can be used to obtain a list of the unwrapped types, such as
<pre><code>
List&lt;String&gt; strings = ary1.getValuesAs(JsonString::getString);
List&lt;Integer&gt; ints = ary2.getValuesAs(JsonNumber::intValue);
</code> </pre>
or a list of simple projections, such as
<pre> <code>
List&lt;Integer&gt; stringsizes = ary1.getValueAs((JsonString v)-&gt;v.getString().length();
</code> </pre></div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>K</code> - The element type (must be a subtype of JsonValue) of this JsonArray.</dd>
<dd><code>T</code> - The element type of the returned List</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>func</code> - The function that maps the elements of this JsonArray to the target elements.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A List of the specified values and type.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassCastException.html?is-external=true" title="class or interface in java.lang">ClassCastException</a></code> - if the <code>JsonArray</code> contains a value of wrong type</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.1</dd>
</dl>
</li>
</ul>
<a name="getString-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getString</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getString&#8203;(int&nbsp;index)</pre>
<div class="block">A convenience method for
<code>getJsonString(index).getString()</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - index of the <code>JsonString</code> value</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the String value at the specified position</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - if the index is out of range</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassCastException.html?is-external=true" title="class or interface in java.lang">ClassCastException</a></code> - if the value at the specified position is not
assignable to <code>JsonString</code></dd>
</dl>
</li>
</ul>
<a name="getString-int-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getString</h4>
<pre><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getString&#8203;(int&nbsp;index,
<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;defaultValue)</pre>
<div class="block">Returns the <code>String</code> value of <code>JsonString</code> at the specified
position in this JSON array values. If <code>JsonString</code> is found,
its <a href="../../javax/json/JsonString.html#getString--"><code>JsonString.getString()</code></a> is returned. Otherwise,
the specified default value is returned.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - index of the <code>JsonString</code> value</dd>
<dd><code>defaultValue</code> - the String to return if the <code>JsonValue</code> at the
specified position is not a <code>JsonString</code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the String value at the specified position in this array,
or the specified default value</dd>
</dl>
</li>
</ul>
<a name="getInt-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getInt</h4>
<pre>int&nbsp;getInt&#8203;(int&nbsp;index)</pre>
<div class="block">A convenience method for
<code>getJsonNumber(index).intValue()</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - index of the <code>JsonNumber</code> value</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the int value at the specified position</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - if the index is out of range</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassCastException.html?is-external=true" title="class or interface in java.lang">ClassCastException</a></code> - if the value at the specified position is not
assignable to <code>JsonNumber</code></dd>
</dl>
</li>
</ul>
<a name="getInt-int-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getInt</h4>
<pre>int&nbsp;getInt&#8203;(int&nbsp;index,
int&nbsp;defaultValue)</pre>
<div class="block">Returns the int value of the <code>JsonNumber</code> at the specified position.
If the value at that position is a <code>JsonNumber</code>,
this method returns <a href="../../javax/json/JsonNumber.html#intValue--"><code>JsonNumber.intValue()</code></a>. Otherwise
this method returns the specified default value.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - index of the <code>JsonNumber</code> value</dd>
<dd><code>defaultValue</code> - the int value to return if the <code>JsonValue</code> at
the specified position is not a <code>JsonNumber</code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the int value at the specified position in this array,
or the specified default value</dd>
</dl>
</li>
</ul>
<a name="getBoolean-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBoolean</h4>
<pre>boolean&nbsp;getBoolean&#8203;(int&nbsp;index)</pre>
<div class="block">Returns the boolean value at the specified position.
If the value at the specified position is <code>JsonValue.TRUE</code>
this method returns <code>true</code>. If the value at the specified position
is <code>JsonValue.FALSE</code> this method returns <code>false</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - index of the JSON boolean value</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the boolean value at the specified position</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - if the index is out of range</dd>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/ClassCastException.html?is-external=true" title="class or interface in java.lang">ClassCastException</a></code> - if the value at the specified position is not
assignable to <code>JsonValue.TRUE</code> or <code>JsonValue.FALSE</code></dd>
</dl>
</li>
</ul>
<a name="getBoolean-int-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBoolean</h4>
<pre>boolean&nbsp;getBoolean&#8203;(int&nbsp;index,
boolean&nbsp;defaultValue)</pre>
<div class="block">Returns the boolean value at the specified position.
If the value at the specified position is <code>JsonValue.TRUE</code>
this method returns <code>true</code>. If the value at the specified position
is <code>JsonValue.FALSE</code> this method returns <code>false</code>.
Otherwise this method returns the specified default value.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - index of the JSON boolean value</dd>
<dd><code>defaultValue</code> - the boolean value to return if the <code>JsonValue</code>
at the specified position is neither TRUE nor FALSE</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the boolean value at the specified position,
or the specified default value</dd>
</dl>
</li>
</ul>
<a name="isNull-int-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>isNull</h4>
<pre>boolean&nbsp;isNull&#8203;(int&nbsp;index)</pre>
<div class="block">Returns <code>true</code> if the value at the specified location in this
array is <code>JsonValue.NULL</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>index</code> - index of the JSON null value</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>return true if the value at the specified location is
<code>JsonValue.NULL</code>, otherwise false</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</a></code> - if the index is out of range</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="../../overview-summary.html">Overview</a></li>
<li><a href="../../java.json-summary.html">Module</a></li>
<li><a href="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="../../javax/json/Json.html" title="class in javax.json"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../javax/json/JsonArrayBuilder.html" title="interface in javax.json"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?javax/json/JsonArray.html" target="_top">Frames</a></li>
<li><a href="JsonArray.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</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 &#169; 2012-2018, <a href="http://www.oracle.com">Oracle</a> and/or its affiliates. All Rights Reserved. Use is subject to <a href="../../doc-files/speclicense.html" target="_top">license terms</a>. <br>Comments to : jsonp-dev@eclipse.org</small></p>
</body>
</html>