<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc (1.8.0_161) on Thu Aug 16 18:54:13 JST 2018 --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSONArray (twitter4j-core 4.0.7 API)</title> <meta name="date" content="2018-08-16"> <link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style"> <script type="text/javascript" src="../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="JSONArray (twitter4j-core 4.0.7 API)"; } } catch(err) { } //--> var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":10,"i28":10,"i29":10,"i30":10,"i31":10,"i32":10,"i33":10,"i34":10,"i35":10,"i36":10,"i37":10,"i38":10,"i39":10}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../overview-summary.html">Overview</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="../twitter4j/IDs.html" title="interface in twitter4j"><span class="typeNameLink">Prev Class</span></a></li> <li><a href="../twitter4j/JSONException.html" title="class in twitter4j"><span class="typeNameLink">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../index.html?twitter4j/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">twitter4j</div> <h2 title="Class JSONArray" class="title">Class JSONArray</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li> <li> <ul class="inheritance"> <li>twitter4j.JSONArray</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>public class <span class="typeNameLabel">JSONArray</span> extends <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre> <div class="block">A dense indexed sequence of values. Values may be any mix of <a href="../twitter4j/JSONObject.html" title="class in twitter4j"><code>JSONObjects</code></a>, other <a href="../twitter4j/JSONArray.html" title="class in twitter4j"><code>JSONArrays</code></a>, Strings, Booleans, Integers, Longs, Doubles, <code>null</code> or <a href="../twitter4j/JSONObject.html#NULL"><code>JSONObject.NULL</code></a>. Values may not be <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Double.html?is-external=true#isNaN--" title="class or interface in java.lang"><code>NaNs</code></a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Double.html?is-external=true#isInfinite--" title="class or interface in java.lang"><code>infinities</code></a>, or of any type not listed here. <code>JSONArray</code> has the same type coercion behavior and optional/mandatory accessors as <a href="../twitter4j/JSONObject.html" title="class in twitter4j"><code>JSONObject</code></a>. See that class' documentation for details. <strong>Warning:</strong> this class represents null in two incompatible ways: the standard Java <code>null</code> reference, and the sentinel value <a href="../twitter4j/JSONObject.html#NULL"><code>JSONObject.NULL</code></a>. In particular, <code>get</code> fails if the requested index holds the null reference, but succeeds if it holds <code>JSONObject.NULL</code>. Instances of this class are not thread safe. Although this class is non-final, it was not designed for inheritance and should not be subclassed. In particular, self-use by overridable methods is not specified. See <i>Effective Java</i> Item 17, "Design and Document or inheritance or else prohibit it" for further information.</div> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd"> </span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#JSONArray--">JSONArray</a></span>()</code> <div class="block">Creates a <code>JSONArray</code> with no values.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#JSONArray-java.util.Collection-">JSONArray</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a> copyFrom)</code> <div class="block">Creates a new <code>JSONArray</code> by copying all values from the given collection.</div> </td> </tr> <tr class="altColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#JSONArray-twitter4j.JSONTokener-">JSONArray</a></span>(<a href="../twitter4j/JSONTokener.html" title="class in twitter4j">JSONTokener</a> readFrom)</code> <div class="block">Creates a new <code>JSONArray</code> with values from the next array in the tokener.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#JSONArray-java.lang.Object-">JSONArray</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> array)</code> <div class="block">Creates a new <code>JSONArray</code> with values from the given primitive array.</div> </td> </tr> <tr class="altColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#JSONArray-java.lang.String-">JSONArray</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> json)</code> <div class="block">Creates a new <code>JSONArray</code> with values from the JSON string.</div> </td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#equals-java.lang.Object-">equals</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> o)</code> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#get-int-">get</a></span>(int index)</code> <div class="block">Returns the value at <code>index</code>.</div> </td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#getBoolean-int-">getBoolean</a></span>(int index)</code> <div class="block">Returns the value at <code>index</code> if it exists and is a boolean or can be coerced to a boolean.</div> </td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code>double</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#getDouble-int-">getDouble</a></span>(int index)</code> <div class="block">Returns the value at <code>index</code> if it exists and is a double or can be coerced to a double.</div> </td> </tr> <tr id="i4" class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#getInt-int-">getInt</a></span>(int index)</code> <div class="block">Returns the value at <code>index</code> if it exists and is an int or can be coerced to an int.</div> </td> </tr> <tr id="i5" class="rowColor"> <td class="colFirst"><code><a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#getJSONArray-int-">getJSONArray</a></span>(int index)</code> <div class="block">Returns the value at <code>index</code> if it exists and is a <code>JSONArray</code>.</div> </td> </tr> <tr id="i6" class="altColor"> <td class="colFirst"><code><a href="../twitter4j/JSONObject.html" title="class in twitter4j">JSONObject</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#getJSONObject-int-">getJSONObject</a></span>(int index)</code> <div class="block">Returns the value at <code>index</code> if it exists and is a <code>JSONObject</code>.</div> </td> </tr> <tr id="i7" class="rowColor"> <td class="colFirst"><code>long</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#getLong-int-">getLong</a></span>(int index)</code> <div class="block">Returns the value at <code>index</code> if it exists and is a long or can be coerced to a long.</div> </td> </tr> <tr id="i8" class="altColor"> <td class="colFirst"><code><a href="http://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> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#getString-int-">getString</a></span>(int index)</code> <div class="block">Returns the value at <code>index</code> if it exists, coercing it if necessary.</div> </td> </tr> <tr id="i9" class="rowColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#hashCode--">hashCode</a></span>()</code> </td> </tr> <tr id="i10" class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#isNull-int-">isNull</a></span>(int index)</code> <div class="block">Returns true if this array has no value at <code>index</code>, or if its value is the <code>null</code> reference or <a href="../twitter4j/JSONObject.html#NULL"><code>JSONObject.NULL</code></a>.</div> </td> </tr> <tr id="i11" class="rowColor"> <td class="colFirst"><code><a href="http://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> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#join-java.lang.String-">join</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> separator)</code> <div class="block">Returns a new string by alternating this array's values with <code>separator</code>.</div> </td> </tr> <tr id="i12" class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#length--">length</a></span>()</code> </td> </tr> <tr id="i13" class="rowColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#opt-int-">opt</a></span>(int index)</code> <div class="block">Returns the value at <code>index</code>, or null if the array has no value at <code>index</code>.</div> </td> </tr> <tr id="i14" class="altColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#optBoolean-int-">optBoolean</a></span>(int index)</code> <div class="block">Returns the value at <code>index</code> if it exists and is a boolean or can be coerced to a boolean.</div> </td> </tr> <tr id="i15" class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#optBoolean-int-boolean-">optBoolean</a></span>(int index, boolean fallback)</code> <div class="block">Returns the value at <code>index</code> if it exists and is a boolean or can be coerced to a boolean.</div> </td> </tr> <tr id="i16" class="altColor"> <td class="colFirst"><code>double</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#optDouble-int-">optDouble</a></span>(int index)</code> <div class="block">Returns the value at <code>index</code> if it exists and is a double or can be coerced to a double.</div> </td> </tr> <tr id="i17" class="rowColor"> <td class="colFirst"><code>double</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#optDouble-int-double-">optDouble</a></span>(int index, double fallback)</code> <div class="block">Returns the value at <code>index</code> if it exists and is a double or can be coerced to a double.</div> </td> </tr> <tr id="i18" class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#optInt-int-">optInt</a></span>(int index)</code> <div class="block">Returns the value at <code>index</code> if it exists and is an int or can be coerced to an int.</div> </td> </tr> <tr id="i19" class="rowColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#optInt-int-int-">optInt</a></span>(int index, int fallback)</code> <div class="block">Returns the value at <code>index</code> if it exists and is an int or can be coerced to an int.</div> </td> </tr> <tr id="i20" class="altColor"> <td class="colFirst"><code><a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#optJSONArray-int-">optJSONArray</a></span>(int index)</code> <div class="block">Returns the value at <code>index</code> if it exists and is a <code>JSONArray</code>.</div> </td> </tr> <tr id="i21" class="rowColor"> <td class="colFirst"><code><a href="../twitter4j/JSONObject.html" title="class in twitter4j">JSONObject</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#optJSONObject-int-">optJSONObject</a></span>(int index)</code> <div class="block">Returns the value at <code>index</code> if it exists and is a <code>JSONObject</code>.</div> </td> </tr> <tr id="i22" class="altColor"> <td class="colFirst"><code>long</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#optLong-int-">optLong</a></span>(int index)</code> <div class="block">Returns the value at <code>index</code> if it exists and is a long or can be coerced to a long.</div> </td> </tr> <tr id="i23" class="rowColor"> <td class="colFirst"><code>long</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#optLong-int-long-">optLong</a></span>(int index, long fallback)</code> <div class="block">Returns the value at <code>index</code> if it exists and is a long or can be coerced to a long.</div> </td> </tr> <tr id="i24" class="altColor"> <td class="colFirst"><code><a href="http://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> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#optString-int-">optString</a></span>(int index)</code> <div class="block">Returns the value at <code>index</code> if it exists, coercing it if necessary.</div> </td> </tr> <tr id="i25" class="rowColor"> <td class="colFirst"><code><a href="http://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> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#optString-int-java.lang.String-">optString</a></span>(int index, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> fallback)</code> <div class="block">Returns the value at <code>index</code> if it exists, coercing it if necessary.</div> </td> </tr> <tr id="i26" class="altColor"> <td class="colFirst"><code><a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#put-boolean-">put</a></span>(boolean value)</code> <div class="block">Appends <code>value</code> to the end of this array.</div> </td> </tr> <tr id="i27" class="rowColor"> <td class="colFirst"><code><a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#put-double-">put</a></span>(double value)</code> <div class="block">Appends <code>value</code> to the end of this array.</div> </td> </tr> <tr id="i28" class="altColor"> <td class="colFirst"><code><a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#put-int-">put</a></span>(int value)</code> <div class="block">Appends <code>value</code> to the end of this array.</div> </td> </tr> <tr id="i29" class="rowColor"> <td class="colFirst"><code><a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#put-int-boolean-">put</a></span>(int index, boolean value)</code> <div class="block">Sets the value at <code>index</code> to <code>value</code>, null padding this array to the required length if necessary.</div> </td> </tr> <tr id="i30" class="altColor"> <td class="colFirst"><code><a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#put-int-double-">put</a></span>(int index, double value)</code> <div class="block">Sets the value at <code>index</code> to <code>value</code>, null padding this array to the required length if necessary.</div> </td> </tr> <tr id="i31" class="rowColor"> <td class="colFirst"><code><a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#put-int-int-">put</a></span>(int index, int value)</code> <div class="block">Sets the value at <code>index</code> to <code>value</code>, null padding this array to the required length if necessary.</div> </td> </tr> <tr id="i32" class="altColor"> <td class="colFirst"><code><a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#put-int-long-">put</a></span>(int index, long value)</code> <div class="block">Sets the value at <code>index</code> to <code>value</code>, null padding this array to the required length if necessary.</div> </td> </tr> <tr id="i33" class="rowColor"> <td class="colFirst"><code><a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#put-int-java.lang.Object-">put</a></span>(int index, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> value)</code> <div class="block">Sets the value at <code>index</code> to <code>value</code>, null padding this array to the required length if necessary.</div> </td> </tr> <tr id="i34" class="altColor"> <td class="colFirst"><code><a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#put-long-">put</a></span>(long value)</code> <div class="block">Appends <code>value</code> to the end of this array.</div> </td> </tr> <tr id="i35" class="rowColor"> <td class="colFirst"><code><a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#put-java.lang.Object-">put</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> value)</code> <div class="block">Appends <code>value</code> to the end of this array.</div> </td> </tr> <tr id="i36" class="altColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#remove-int-">remove</a></span>(int index)</code> <div class="block">Removes and returns the value at <code>index</code>, or null if the array has no value at <code>index</code>.</div> </td> </tr> <tr id="i37" class="rowColor"> <td class="colFirst"><code><a href="../twitter4j/JSONObject.html" title="class in twitter4j">JSONObject</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#toJSONObject-twitter4j.JSONArray-">toJSONObject</a></span>(<a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a> names)</code> <div class="block">Returns a new object whose values are the values in this array, and whose names are the values in <code>names</code>.</div> </td> </tr> <tr id="i38" class="altColor"> <td class="colFirst"><code><a href="http://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> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#toString--">toString</a></span>()</code> <div class="block">Encodes this array as a compact JSON string, such as:</div> </td> </tr> <tr id="i39" class="rowColor"> <td class="colFirst"><code><a href="http://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> <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONArray.html#toString-int-">toString</a></span>(int indentSpaces)</code> <div class="block">Encodes this array as a human readable JSON string for debugging, such as:</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.<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> <code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="JSONArray--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>JSONArray</h4> <pre>public JSONArray()</pre> <div class="block">Creates a <code>JSONArray</code> with no values.</div> </li> </ul> <a name="JSONArray-java.util.Collection-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>JSONArray</h4> <pre>public JSONArray(<a href="http://docs.oracle.com/javase/8/docs/api/java/util/Collection.html?is-external=true" title="class or interface in java.util">Collection</a> copyFrom)</pre> <div class="block">Creates a new <code>JSONArray</code> by copying all values from the given collection.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>copyFrom</code> - a collection whose values are of supported types. Unsupported values are not permitted and will yield an array in an inconsistent state.</dd> </dl> </li> </ul> <a name="JSONArray-twitter4j.JSONTokener-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>JSONArray</h4> <pre>public JSONArray(<a href="../twitter4j/JSONTokener.html" title="class in twitter4j">JSONTokener</a> readFrom) throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre> <div class="block">Creates a new <code>JSONArray</code> with values from the next array in the tokener.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>readFrom</code> - a tokener whose nextValue() method will yield a <code>JSONArray</code>.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - if the parse fails or doesn't yield a <code>JSONArray</code>.</dd> </dl> </li> </ul> <a name="JSONArray-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>JSONArray</h4> <pre>public JSONArray(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> json) throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre> <div class="block">Creates a new <code>JSONArray</code> with values from the JSON string.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>json</code> - a JSON-encoded string containing an array.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - if the parse fails or doesn't yield a <code>JSONArray</code>.</dd> </dl> </li> </ul> <a name="JSONArray-java.lang.Object-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>JSONArray</h4> <pre>public JSONArray(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> array) throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre> <div class="block">Creates a new <code>JSONArray</code> with values from the given primitive array.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>array</code> - The values to use.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - if any of the values are non-finite double values (i.e. NaN or infinite)</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="length--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>length</h4> <pre>public int length()</pre> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>Returns the number of values in this array.</dd> </dl> </li> </ul> <a name="put-boolean-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>put</h4> <pre>public <a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a> put(boolean value)</pre> <div class="block">Appends <code>value</code> to the end of this array.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>value</code> - The value to append.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>this array.</dd> </dl> </li> </ul> <a name="put-double-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>put</h4> <pre>public <a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a> put(double value) throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre> <div class="block">Appends <code>value</code> to the end of this array.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>value</code> - a finite value. May not be <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Double.html?is-external=true#isNaN--" title="class or interface in java.lang"><code>NaNs</code></a> or <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Double.html?is-external=true#isInfinite--" title="class or interface in java.lang"><code>infinities</code></a>.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>this array.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - If the value is unacceptable.</dd> </dl> </li> </ul> <a name="put-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>put</h4> <pre>public <a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a> put(int value)</pre> <div class="block">Appends <code>value</code> to the end of this array.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>value</code> - The value to append.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>this array.</dd> </dl> </li> </ul> <a name="put-long-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>put</h4> <pre>public <a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a> put(long value)</pre> <div class="block">Appends <code>value</code> to the end of this array.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>value</code> - The value to append.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>this array.</dd> </dl> </li> </ul> <a name="put-java.lang.Object-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>put</h4> <pre>public <a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a> put(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> value)</pre> <div class="block">Appends <code>value</code> to the end of this array.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>value</code> - a <a href="../twitter4j/JSONObject.html" title="class in twitter4j"><code>JSONObject</code></a>, <a href="../twitter4j/JSONArray.html" title="class in twitter4j"><code>JSONArray</code></a>, String, Boolean, Integer, Long, Double, <a href="../twitter4j/JSONObject.html#NULL"><code>JSONObject.NULL</code></a>, or <code>null</code>. May not be <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Double.html?is-external=true#isNaN--" title="class or interface in java.lang"><code>NaNs</code></a> or <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Double.html?is-external=true#isInfinite--" title="class or interface in java.lang"><code>infinities</code></a>. Unsupported values are not permitted and will cause the array to be in an inconsistent state.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>this array.</dd> </dl> </li> </ul> <a name="put-int-boolean-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>put</h4> <pre>public <a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a> put(int index, boolean value) throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre> <div class="block">Sets the value at <code>index</code> to <code>value</code>, null padding this array to the required length if necessary. If a value already exists at <code>index</code>, it will be replaced.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - Where to put the value.</dd> <dd><code>value</code> - The value to set.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>this array.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - This should never happen.</dd> </dl> </li> </ul> <a name="put-int-double-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>put</h4> <pre>public <a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a> put(int index, double value) throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre> <div class="block">Sets the value at <code>index</code> to <code>value</code>, null padding this array to the required length if necessary. If a value already exists at <code>index</code>, it will be replaced.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - Where to put the value.</dd> <dd><code>value</code> - a finite value. May not be <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Double.html?is-external=true#isNaN--" title="class or interface in java.lang"><code>NaNs</code></a> or <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Double.html?is-external=true#isInfinite--" title="class or interface in java.lang"><code>infinities</code></a>.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>this array.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - If the value is not a finite value.</dd> </dl> </li> </ul> <a name="put-int-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>put</h4> <pre>public <a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a> put(int index, int value) throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre> <div class="block">Sets the value at <code>index</code> to <code>value</code>, null padding this array to the required length if necessary. If a value already exists at <code>index</code>, it will be replaced.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - Where to put the value.</dd> <dd><code>value</code> - The value to set.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>this array.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - Should never actually happen.</dd> </dl> </li> </ul> <a name="put-int-long-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>put</h4> <pre>public <a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a> put(int index, long value) throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre> <div class="block">Sets the value at <code>index</code> to <code>value</code>, null padding this array to the required length if necessary. If a value already exists at <code>index</code>, it will be replaced.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - Where to put the value.</dd> <dd><code>value</code> - The value to set.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>this array.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - Should never actually happen.</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="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a> put(int index, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> value) throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre> <div class="block">Sets the value at <code>index</code> to <code>value</code>, null padding this array to the required length if necessary. If a value already exists at <code>index</code>, it will be replaced.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - Where to put the value.</dd> <dd><code>value</code> - a <a href="../twitter4j/JSONObject.html" title="class in twitter4j"><code>JSONObject</code></a>, <a href="../twitter4j/JSONArray.html" title="class in twitter4j"><code>JSONArray</code></a>, String, Boolean, Integer, Long, Double, <a href="../twitter4j/JSONObject.html#NULL"><code>JSONObject.NULL</code></a>, or <code>null</code>. May not be <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Double.html?is-external=true#isNaN--" title="class or interface in java.lang"><code>NaNs</code></a> or <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Double.html?is-external=true#isInfinite--" title="class or interface in java.lang"><code>infinities</code></a>.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>this array.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - If the value cannot be represented as a finite double value.</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">Returns true if this array has no value at <code>index</code>, or if its value is the <code>null</code> reference or <a href="../twitter4j/JSONObject.html#NULL"><code>JSONObject.NULL</code></a>.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - Which value to check.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>true if the value is null.</dd> </dl> </li> </ul> <a name="get-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>get</h4> <pre>public <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> get(int index) throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre> <div class="block">Returns the value at <code>index</code>.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - Which value to get.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the value at the specified location.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - if this array has no value at <code>index</code>, or if that value is the <code>null</code> reference. This method returns normally if the value is <code>JSONObject#NULL</code>.</dd> </dl> </li> </ul> <a name="opt-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>opt</h4> <pre>public <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> opt(int index)</pre> <div class="block">Returns the value at <code>index</code>, or null if the array has no value at <code>index</code>.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - Which value to get.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the value at the specified location.</dd> </dl> </li> </ul> <a name="remove-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>remove</h4> <pre>public <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> remove(int index)</pre> <div class="block">Removes and returns the value at <code>index</code>, or null if the array has no value at <code>index</code>.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - Which value to remove.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>The value previously at the specified location.</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="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre> <div class="block">Returns the value at <code>index</code> if it exists and is a boolean or can be coerced to a boolean.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - Which value to get.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the value at the specified location.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - if the value at <code>index</code> doesn't exist or cannot be coerced to a boolean.</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">Returns the value at <code>index</code> if it exists and is a boolean or can be coerced to a boolean. Returns false otherwise.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - Which value to get.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the value at the specified location.</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 fallback)</pre> <div class="block">Returns the value at <code>index</code> if it exists and is a boolean or can be coerced to a boolean. Returns <code>fallback</code> otherwise.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - Which value to get.</dd> <dd><code>fallback</code> - the fallback value to return if no value exists.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the value at the specified location or the fallback value.</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="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre> <div class="block">Returns the value at <code>index</code> if it exists and is a double or can be coerced to a double.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - Which value to get.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the value at the specified location.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - if the value at <code>index</code> doesn't exist or cannot be coerced to a double.</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">Returns the value at <code>index</code> if it exists and is a double or can be coerced to a double. Returns <code>NaN</code> otherwise.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - Which value to get.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the value at the specified location.</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 fallback)</pre> <div class="block">Returns the value at <code>index</code> if it exists and is a double or can be coerced to a double. Returns <code>fallback</code> otherwise.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - Which value to get.</dd> <dd><code>fallback</code> - The fallback value to use if no value is at the specified location.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the value at the specified location or the fallback value.</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="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre> <div class="block">Returns the value at <code>index</code> if it exists and is an int or can be coerced to an int.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - Which value to get.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the value at the specified location.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - if the value at <code>index</code> doesn't exist or cannot be coerced to a int.</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">Returns the value at <code>index</code> if it exists and is an int or can be coerced to an int. Returns 0 otherwise.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - Which value to get.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the value at the specified location.</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 fallback)</pre> <div class="block">Returns the value at <code>index</code> if it exists and is an int or can be coerced to an int. Returns <code>fallback</code> otherwise.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - Which value to get.</dd> <dd><code>fallback</code> - The fallback value to use if no value is at the specified location.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the value at the specified location or the fallback value.</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="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre> <div class="block">Returns the value at <code>index</code> if it exists and is a long or can be coerced to a long.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - Which value to get.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the value at the specified location.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - if the value at <code>index</code> doesn't exist or cannot be coerced to a long.</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">Returns the value at <code>index</code> if it exists and is a long or can be coerced to a long. Returns 0 otherwise.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - Which value to get.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the value at the specified location.</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 fallback)</pre> <div class="block">Returns the value at <code>index</code> if it exists and is a long or can be coerced to a long. Returns <code>fallback</code> otherwise.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - Which value to get.</dd> <dd><code>fallback</code> - The fallback value to use if no value is at the specified location.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the value at the specified location or the fallback value.</dd> </dl> </li> </ul> <a name="getString-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getString</h4> <pre>public <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> getString(int index) throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre> <div class="block">Returns the value at <code>index</code> if it exists, coercing it if necessary.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - Which value to get.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the value at the specified location.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - if no such value exists.</dd> </dl> </li> </ul> <a name="optString-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>optString</h4> <pre>public <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> optString(int index)</pre> <div class="block">Returns the value at <code>index</code> if it exists, coercing it if necessary. Returns the empty string if no such value exists.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - Which value to get.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the value at the specified location.</dd> </dl> </li> </ul> <a name="optString-int-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>optString</h4> <pre>public <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> optString(int index, <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> fallback)</pre> <div class="block">Returns the value at <code>index</code> if it exists, coercing it if necessary. Returns <code>fallback</code> if no such value exists.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - Which value to get.</dd> <dd><code>fallback</code> - The fallback value to use if no value is at the specified location.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the value at the specified location or the fallback value.</dd> </dl> </li> </ul> <a name="getJSONArray-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getJSONArray</h4> <pre>public <a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a> getJSONArray(int index) throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre> <div class="block">Returns the value at <code>index</code> if it exists and is a <code>JSONArray</code>.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - Which value to get.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the value at the specified location.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - if the value doesn't exist or is not a <code>JSONArray</code>.</dd> </dl> </li> </ul> <a name="optJSONArray-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>optJSONArray</h4> <pre>public <a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a> optJSONArray(int index)</pre> <div class="block">Returns the value at <code>index</code> if it exists and is a <code>JSONArray</code>. Returns null otherwise.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - Which value to get.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the value at the specified location.</dd> </dl> </li> </ul> <a name="getJSONObject-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getJSONObject</h4> <pre>public <a href="../twitter4j/JSONObject.html" title="class in twitter4j">JSONObject</a> getJSONObject(int index) throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre> <div class="block">Returns the value at <code>index</code> if it exists and is a <code>JSONObject</code>.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - Which value to get.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the value at the specified location.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - if the value doesn't exist or is not a <code>JSONObject</code>.</dd> </dl> </li> </ul> <a name="optJSONObject-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>optJSONObject</h4> <pre>public <a href="../twitter4j/JSONObject.html" title="class in twitter4j">JSONObject</a> optJSONObject(int index)</pre> <div class="block">Returns the value at <code>index</code> if it exists and is a <code>JSONObject</code>. Returns null otherwise.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>index</code> - Which value to get.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the value at the specified location.</dd> </dl> </li> </ul> <a name="toJSONObject-twitter4j.JSONArray-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>toJSONObject</h4> <pre>public <a href="../twitter4j/JSONObject.html" title="class in twitter4j">JSONObject</a> toJSONObject(<a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a> names) throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre> <div class="block">Returns a new object whose values are the values in this array, and whose names are the values in <code>names</code>. Names and values are paired up by index from 0 through to the shorter array's length. Names that are not strings will be coerced to strings. This method returns null if either array is empty.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>names</code> - The names to apply to the returned values.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the newly constructed object.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - Should not be possible.</dd> </dl> </li> </ul> <a name="join-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>join</h4> <pre>public <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> join(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> separator) throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre> <div class="block">Returns a new string by alternating this array's values with <code>separator</code>. This array's string values are quoted and have their special characters escaped. For example, the array containing the strings '12" pizza', 'taco' and 'soda' joined on '+' returns this: <pre>"12\" pizza"+"taco"+"soda"</pre></div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>separator</code> - The string used to separate the returned values.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the conjoined values.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - Only if there is a coding error.</dd> </dl> </li> </ul> <a name="toString--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>toString</h4> <pre>public <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> toString()</pre> <div class="block">Encodes this array as a compact JSON string, such as: <pre>[94043,90210]</pre></div> <dl> <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> <dd><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a></code> in class <code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>The string form of this array.</dd> </dl> </li> </ul> <a name="toString-int-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>toString</h4> <pre>public <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> toString(int indentSpaces) throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre> <div class="block">Encodes this array as a human readable JSON string for debugging, such as: <pre> [ 94043, 90210 ]</pre></div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>indentSpaces</code> - the number of spaces to indent for each level of nesting.</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>The string form of this array.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - Only if there is a coding error.</dd> </dl> </li> </ul> <a name="equals-java.lang.Object-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>equals</h4> <pre>public boolean equals(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> o)</pre> <dl> <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> <dd><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a></code> in class <code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd> </dl> </li> </ul> <a name="hashCode--"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>hashCode</h4> <pre>public int hashCode()</pre> <dl> <dt><span class="overrideSpecifyLabel">Overrides:</span></dt> <dd><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a></code> in class <code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../overview-summary.html">Overview</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="../twitter4j/IDs.html" title="interface in twitter4j"><span class="typeNameLink">Prev Class</span></a></li> <li><a href="../twitter4j/JSONException.html" title="class in twitter4j"><span class="typeNameLink">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../index.html?twitter4j/JSONArray.html" target="_top">Frames</a></li> <li><a href="JSONArray.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary: </li> <li>Nested | </li> <li>Field | </li> <li><a href="#constructor.summary">Constr</a> | </li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li>Field | </li> <li><a href="#constructor.detail">Constr</a> | </li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright © 2018. All rights reserved.</small></p> </body> </html>