1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588 |
- <!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>JSONObject (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="JSONObject (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":9,"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":9,"i37":10,"i38":10,"i39":10,"i40":10,"i41":9};
- var tabs = {65535:["t0","All Methods"],1:["t1","Static 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/JSONObject.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/JSONException.html" title="class in twitter4j"><span class="typeNameLink">Prev Class</span></a></li>
- <li><a href="../twitter4j/JSONObjectType.html" title="class in twitter4j"><span class="typeNameLink">Next Class</span></a></li>
- </ul>
- <ul class="navList">
- <li><a href="../index.html?twitter4j/JSONObject.html" target="_top">Frames</a></li>
- <li><a href="JSONObject.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><a href="#field.summary">Field</a> | </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><a href="#field.detail">Field</a> | </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 JSONObject" class="title">Class JSONObject</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.JSONObject</li>
- </ul>
- </li>
- </ul>
- <div class="description">
- <ul class="blockList">
- <li class="blockList">
- <hr>
- <br>
- <pre>public class <span class="typeNameLabel">JSONObject</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 modifiable set of name/value mappings. Names are unique, non-null strings.
- Values may be any mix of <a href="../twitter4j/JSONObject.html" title="class in twitter4j"><code>JSONObjects</code></a>, <a href="../twitter4j/JSONArray.html" title="class in twitter4j"><code>JSONArrays</code></a>, Strings, Booleans, Integers, Longs, Doubles or <a href="../twitter4j/JSONObject.html#NULL"><code>NULL</code></a>.
- Values may not be <code>null</code>, <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.
- <p>This class can coerce values to another type when requested.
- <ul>
- <li>When the requested type is a boolean, strings will be coerced using a
- case-insensitive comparison to "true" and "false".
- <li>When the requested type is a double, other <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang"><code>Number</code></a> types will
- be coerced using <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true#doubleValue--" title="class or interface in java.lang"><code>doubleValue</code></a>. Strings
- that can be coerced using <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Double.html?is-external=true#valueOf-java.lang.String-" title="class or interface in java.lang"><code>Double.valueOf(String)</code></a> will be.
- <li>When the requested type is an int, other <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang"><code>Number</code></a> types will
- be coerced using <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true#intValue--" title="class or interface in java.lang"><code>intValue</code></a>. Strings
- that can be coerced using <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Double.html?is-external=true#valueOf-java.lang.String-" title="class or interface in java.lang"><code>Double.valueOf(String)</code></a> will be,
- and then cast to int.
- <li><a name="lossy">When the requested type is a long, other <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang"><code>Number</code></a> types will
- be coerced using <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true#longValue--" title="class or interface in java.lang"><code>longValue</code></a>. Strings
- that can be coerced using <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Double.html?is-external=true#valueOf-java.lang.String-" title="class or interface in java.lang"><code>Double.valueOf(String)</code></a> will be,
- and then cast to long. This two-step conversion is lossy for very
- large values. For example, the string "9223372036854775806" yields the
- long 9223372036854775807.</a>
- <li>When the requested type is a String, other non-null values will be
- coerced using <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true#valueOf-java.lang.Object-" title="class or interface in java.lang"><code>String.valueOf(Object)</code></a>. Although null cannot be
- coerced, the sentinel value <a href="../twitter4j/JSONObject.html#NULL"><code>NULL</code></a> is coerced to the
- string "null".
- </ul>
- <p>This class can look up both mandatory and optional values:
- <ul>
- <li>Use <code>get<i>Type</i>()</code> to retrieve a mandatory value. This
- fails with a <code>JSONException</code> if the requested name has no value
- or if the value cannot be coerced to the requested type.
- <li>Use <code>opt<i>Type</i>()</code> to retrieve an optional value. This
- returns a system- or user-supplied default if the requested name has no
- value or if the value cannot be coerced to the requested type.
- </ul>
- <p><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>NULL</code></a>. In particular, calling <code>put(name, null)</code> removes the
- named entry from the object but <code>put(name, JSONObject.NULL)</code> stores an
- entry whose value is <code>JSONObject.NULL</code>.
- <p>Instances of this class are not thread safe. Although this class is
- nonfinal, it was not designed for inheritance and should not be subclassed.
- In particular, self-use by overrideable 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">
- <!-- =========== FIELD SUMMARY =========== -->
- <ul class="blockList">
- <li class="blockList"><a name="field.summary">
- <!-- -->
- </a>
- <h3>Field Summary</h3>
- <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
- <caption><span>Fields</span><span class="tabEnd"> </span></caption>
- <tr>
- <th class="colFirst" scope="col">Modifier and Type</th>
- <th class="colLast" scope="col">Field and Description</th>
- </tr>
- <tr class="altColor">
- <td class="colFirst"><code>static <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/JSONObject.html#NULL">NULL</a></span></code>
- <div class="block">A sentinel value used to explicitly define a name with no value.</div>
- </td>
- </tr>
- </table>
- </li>
- </ul>
- <!-- ======== 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/JSONObject.html#JSONObject--">JSONObject</a></span>()</code>
- <div class="block">Creates a <code>JSONObject</code> with no name/value mappings.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colOne"><code><span class="memberNameLink"><a href="../twitter4j/JSONObject.html#JSONObject-twitter4j.JSONObject-java.lang.String:A-">JSONObject</a></span>(<a href="../twitter4j/JSONObject.html" title="class in twitter4j">JSONObject</a> copyFrom,
- <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>[] names)</code>
- <div class="block">Creates a new <code>JSONObject</code> by copying mappings for the listed names
- from the given object.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colOne"><code><span class="memberNameLink"><a href="../twitter4j/JSONObject.html#JSONObject-twitter4j.JSONTokener-">JSONObject</a></span>(<a href="../twitter4j/JSONTokener.html" title="class in twitter4j">JSONTokener</a> readFrom)</code>
- <div class="block">Creates a new <code>JSONObject</code> with name/value mappings from the next
- object in the tokener.</div>
- </td>
- </tr>
- <tr class="rowColor">
- <td class="colOne"><code><span class="memberNameLink"><a href="../twitter4j/JSONObject.html#JSONObject-java.util.Map-">JSONObject</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a> copyFrom)</code>
- <div class="block">Creates a new <code>JSONObject</code> by copying all name/value mappings from
- the given map.</div>
- </td>
- </tr>
- <tr class="altColor">
- <td class="colOne"><code><span class="memberNameLink"><a href="../twitter4j/JSONObject.html#JSONObject-java.lang.String-">JSONObject</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>JSONObject</code> with name/value mappings 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="t1" class="tableTab"><span><a href="javascript:show(1);">Static Methods</a></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><a href="../twitter4j/JSONObject.html" title="class in twitter4j">JSONObject</a></code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONObject.html#accumulate-java.lang.String-java.lang.Object-">accumulate</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> name,
- <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 array already mapped to <code>name</code>.</div>
- </td>
- </tr>
- <tr id="i1" 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/JSONObject.html#append-java.lang.String-java.lang.Object-">append</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> name,
- <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 values to the array mapped to <code>name</code>.</div>
- </td>
- </tr>
- <tr id="i2" 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/JSONObject.html#get-java.lang.String-">get</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> name)</code>
- <div class="block">Returns the value mapped by <code>name</code>, or throws if no such mapping exists.</div>
- </td>
- </tr>
- <tr id="i3" class="rowColor">
- <td class="colFirst"><code>boolean</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONObject.html#getBoolean-java.lang.String-">getBoolean</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> name)</code>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is a boolean or
- can be coerced to a boolean, or throws otherwise.</div>
- </td>
- </tr>
- <tr id="i4" class="altColor">
- <td class="colFirst"><code>double</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONObject.html#getDouble-java.lang.String-">getDouble</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> name)</code>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is a double or
- can be coerced to a double, or throws otherwise.</div>
- </td>
- </tr>
- <tr id="i5" class="rowColor">
- <td class="colFirst"><code>int</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONObject.html#getInt-java.lang.String-">getInt</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> name)</code>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is an int or
- can be coerced to an int, or throws otherwise.</div>
- </td>
- </tr>
- <tr id="i6" 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/JSONObject.html#getJSONArray-java.lang.String-">getJSONArray</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> name)</code>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is a <code>JSONArray</code>, or throws otherwise.</div>
- </td>
- </tr>
- <tr id="i7" 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/JSONObject.html#getJSONObject-java.lang.String-">getJSONObject</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> name)</code>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is a <code>JSONObject</code>, or throws otherwise.</div>
- </td>
- </tr>
- <tr id="i8" class="altColor">
- <td class="colFirst"><code>long</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONObject.html#getLong-java.lang.String-">getLong</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> name)</code>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is a long or
- can be coerced to a long, or throws otherwise.</div>
- </td>
- </tr>
- <tr id="i9" 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/JSONObject.html#getString-java.lang.String-">getString</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> name)</code>
- <div class="block">Returns the value mapped by <code>name</code> if it exists, coercing it if
- necessary, or throws if no such mapping exists.</div>
- </td>
- </tr>
- <tr id="i10" class="altColor">
- <td class="colFirst"><code>boolean</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONObject.html#has-java.lang.String-">has</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> name)</code>
- <div class="block">Returns true if this object has a mapping for <code>name</code>.</div>
- </td>
- </tr>
- <tr id="i11" class="rowColor">
- <td class="colFirst"><code>boolean</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONObject.html#isNull-java.lang.String-">isNull</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> name)</code>
- <div class="block">Returns true if this object has no mapping for <code>name</code> or if it has
- a mapping whose value is <a href="../twitter4j/JSONObject.html#NULL"><code>NULL</code></a>.</div>
- </td>
- </tr>
- <tr id="i12" class="altColor">
- <td class="colFirst"><code><a href="http://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</a><<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/JSONObject.html#keys--">keys</a></span>()</code>
- <div class="block">Returns an iterator of the <code>String</code> names in this object.</div>
- </td>
- </tr>
- <tr id="i13" class="rowColor">
- <td class="colFirst"><code><a href="http://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a><<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/JSONObject.html#keySet--">keySet</a></span>()</code>
- <div class="block">Returns the set of <code>String</code> names in this object.</div>
- </td>
- </tr>
- <tr id="i14" class="altColor">
- <td class="colFirst"><code>int</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONObject.html#length--">length</a></span>()</code>
- <div class="block">Returns the number of name/value mappings in this object.</div>
- </td>
- </tr>
- <tr id="i15" 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/JSONObject.html#names--">names</a></span>()</code>
- <div class="block">Returns an array containing the string names in this object.</div>
- </td>
- </tr>
- <tr id="i16" class="altColor">
- <td class="colFirst"><code>static <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/JSONObject.html#numberToString-java.lang.Number-">numberToString</a></span>(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang">Number</a> number)</code>
- <div class="block">Encodes the number as a JSON string.</div>
- </td>
- </tr>
- <tr id="i17" 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/JSONObject.html#opt-java.lang.String-">opt</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> name)</code>
- <div class="block">Returns the value mapped by <code>name</code>, or null if no such mapping
- exists.</div>
- </td>
- </tr>
- <tr id="i18" class="altColor">
- <td class="colFirst"><code>boolean</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONObject.html#optBoolean-java.lang.String-">optBoolean</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> name)</code>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is a boolean or
- can be coerced to a boolean, or false otherwise.</div>
- </td>
- </tr>
- <tr id="i19" class="rowColor">
- <td class="colFirst"><code>boolean</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONObject.html#optBoolean-java.lang.String-boolean-">optBoolean</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> name,
- boolean fallback)</code>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is a boolean or
- can be coerced to a boolean, or <code>fallback</code> otherwise.</div>
- </td>
- </tr>
- <tr id="i20" class="altColor">
- <td class="colFirst"><code>double</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONObject.html#optDouble-java.lang.String-">optDouble</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> name)</code>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is a double or
- can be coerced to a double, or <code>NaN</code> otherwise.</div>
- </td>
- </tr>
- <tr id="i21" class="rowColor">
- <td class="colFirst"><code>double</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONObject.html#optDouble-java.lang.String-double-">optDouble</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> name,
- double fallback)</code>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is a double or
- can be coerced to a double, or <code>fallback</code> otherwise.</div>
- </td>
- </tr>
- <tr id="i22" class="altColor">
- <td class="colFirst"><code>int</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONObject.html#optInt-java.lang.String-">optInt</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> name)</code>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is an int or
- can be coerced to an int, or 0 otherwise.</div>
- </td>
- </tr>
- <tr id="i23" class="rowColor">
- <td class="colFirst"><code>int</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONObject.html#optInt-java.lang.String-int-">optInt</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> name,
- int fallback)</code>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is an int or
- can be coerced to an int, or <code>fallback</code> otherwise.</div>
- </td>
- </tr>
- <tr id="i24" 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/JSONObject.html#optJSONArray-java.lang.String-">optJSONArray</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> name)</code>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is a <code>JSONArray</code>, or null otherwise.</div>
- </td>
- </tr>
- <tr id="i25" 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/JSONObject.html#optJSONObject-java.lang.String-">optJSONObject</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> name)</code>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is a <code>JSONObject</code>, or null otherwise.</div>
- </td>
- </tr>
- <tr id="i26" class="altColor">
- <td class="colFirst"><code>long</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONObject.html#optLong-java.lang.String-">optLong</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> name)</code>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is a long or
- can be coerced to a long, or 0 otherwise.</div>
- </td>
- </tr>
- <tr id="i27" class="rowColor">
- <td class="colFirst"><code>long</code></td>
- <td class="colLast"><code><span class="memberNameLink"><a href="../twitter4j/JSONObject.html#optLong-java.lang.String-long-">optLong</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> name,
- long fallback)</code>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is a long or
- can be coerced to a long, or <code>fallback</code> otherwise.</div>
- </td>
- </tr>
- <tr id="i28" 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/JSONObject.html#optString-java.lang.String-">optString</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> name)</code>
- <div class="block">Returns the value mapped by <code>name</code> if it exists, coercing it if
- necessary, or the empty string if no such mapping exists.</div>
- </td>
- </tr>
- <tr id="i29" 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/JSONObject.html#optString-java.lang.String-java.lang.String-">optString</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> name,
- <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 mapped by <code>name</code> if it exists, coercing it if
- necessary, or <code>fallback</code> if no such mapping exists.</div>
- </td>
- </tr>
- <tr id="i30" 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/JSONObject.html#put-java.lang.String-boolean-">put</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> name,
- boolean value)</code>
- <div class="block">Maps <code>name</code> to <code>value</code>, clobbering any existing name/value
- mapping with the same name.</div>
- </td>
- </tr>
- <tr id="i31" 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/JSONObject.html#put-java.lang.String-double-">put</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> name,
- double value)</code>
- <div class="block">Maps <code>name</code> to <code>value</code>, clobbering any existing name/value
- mapping with the same name.</div>
- </td>
- </tr>
- <tr id="i32" 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/JSONObject.html#put-java.lang.String-int-">put</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> name,
- int value)</code>
- <div class="block">Maps <code>name</code> to <code>value</code>, clobbering any existing name/value
- mapping with the same name.</div>
- </td>
- </tr>
- <tr id="i33" 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/JSONObject.html#put-java.lang.String-long-">put</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> name,
- long value)</code>
- <div class="block">Maps <code>name</code> to <code>value</code>, clobbering any existing name/value
- mapping with the same name.</div>
- </td>
- </tr>
- <tr id="i34" 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/JSONObject.html#put-java.lang.String-java.lang.Object-">put</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> name,
- <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">Maps <code>name</code> to <code>value</code>, clobbering any existing name/value
- mapping with the same name.</div>
- </td>
- </tr>
- <tr id="i35" 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/JSONObject.html#putOpt-java.lang.String-java.lang.Object-">putOpt</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> name,
- <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">Equivalent to <code>put(name, value)</code> when both parameters are non-null;
- does nothing otherwise.</div>
- </td>
- </tr>
- <tr id="i36" class="altColor">
- <td class="colFirst"><code>static <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/JSONObject.html#quote-java.lang.String-">quote</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> data)</code>
- <div class="block">Encodes <code>data</code> as a JSON string.</div>
- </td>
- </tr>
- <tr id="i37" 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/JSONObject.html#remove-java.lang.String-">remove</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> name)</code>
- <div class="block">Removes the named mapping if it exists; does nothing otherwise.</div>
- </td>
- </tr>
- <tr id="i38" 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/JSONObject.html#toJSONArray-twitter4j.JSONArray-">toJSONArray</a></span>(<a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a> names)</code>
- <div class="block">Returns an array with the values corresponding to <code>names</code>.</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/JSONObject.html#toString--">toString</a></span>()</code>
- <div class="block">Encodes this object as a compact JSON string, such as:</div>
- </td>
- </tr>
- <tr id="i40" 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/JSONObject.html#toString-int-">toString</a></span>(int indentSpaces)</code>
- <div class="block">Encodes this object as a human readable JSON string for debugging, such
- as:</div>
- </td>
- </tr>
- <tr id="i41" class="rowColor">
- <td class="colFirst"><code>static <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/JSONObject.html#wrap-java.lang.Object-">wrap</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>
- <div class="block">Wraps the given object if necessary.</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#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <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#hashCode--" title="class or interface in java.lang">hashCode</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">
- <!-- ============ FIELD DETAIL =========== -->
- <ul class="blockList">
- <li class="blockList"><a name="field.detail">
- <!-- -->
- </a>
- <h3>Field Detail</h3>
- <a name="NULL">
- <!-- -->
- </a>
- <ul class="blockListLast">
- <li class="blockList">
- <h4>NULL</h4>
- <pre>public static final <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> NULL</pre>
- <div class="block">A sentinel value used to explicitly define a name with no value. Unlike
- <code>null</code>, names with this value:
- <ul>
- <li>show up in the <a href="../twitter4j/JSONObject.html#names--"><code>names()</code></a> array
- <li>show up in the <a href="../twitter4j/JSONObject.html#keys--"><code>keys()</code></a> iterator
- <li>return <code>true</code> for <a href="../twitter4j/JSONObject.html#has-java.lang.String-"><code>has(String)</code></a>
- <li>do not throw on <a href="../twitter4j/JSONObject.html#get-java.lang.String-"><code>get(String)</code></a>
- <li>are included in the encoded JSON string.
- </ul>
- <p>This value violates the general contract of <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"><code>Object.equals(java.lang.Object)</code></a> by
- returning true when compared to <code>null</code>. Its <a href="../twitter4j/JSONObject.html#toString--"><code>toString()</code></a>
- method returns "null".</div>
- </li>
- </ul>
- </li>
- </ul>
- <!-- ========= CONSTRUCTOR DETAIL ======== -->
- <ul class="blockList">
- <li class="blockList"><a name="constructor.detail">
- <!-- -->
- </a>
- <h3>Constructor Detail</h3>
- <a name="JSONObject--">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>JSONObject</h4>
- <pre>public JSONObject()</pre>
- <div class="block">Creates a <code>JSONObject</code> with no name/value mappings.</div>
- </li>
- </ul>
- <a name="JSONObject-java.util.Map-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>JSONObject</h4>
- <pre>public JSONObject(<a href="http://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a> copyFrom)</pre>
- <div class="block">Creates a new <code>JSONObject</code> by copying all name/value mappings from
- the given map.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>copyFrom</code> - a map whose keys are of type <a href="http://docs.oracle.com/javase/8/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang"><code>String</code></a> and whose
- values are of supported types.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="http://docs.oracle.com/javase/8/docs/api/java/lang/NullPointerException.html?is-external=true" title="class or interface in java.lang">NullPointerException</a></code> - if any of the map's keys are null.</dd>
- </dl>
- </li>
- </ul>
- <a name="JSONObject-twitter4j.JSONTokener-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>JSONObject</h4>
- <pre>public JSONObject(<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>JSONObject</code> with name/value mappings from the next
- object 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>JSONObject</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>JSONObject</code>.</dd>
- </dl>
- </li>
- </ul>
- <a name="JSONObject-java.lang.String-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>JSONObject</h4>
- <pre>public JSONObject(<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>JSONObject</code> with name/value mappings from the JSON
- string.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>json</code> - a JSON-encoded string containing an object.</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>JSONObject</code>.</dd>
- </dl>
- </li>
- </ul>
- <a name="JSONObject-twitter4j.JSONObject-java.lang.String:A-">
- <!-- -->
- </a>
- <ul class="blockListLast">
- <li class="blockList">
- <h4>JSONObject</h4>
- <pre>public JSONObject(<a href="../twitter4j/JSONObject.html" title="class in twitter4j">JSONObject</a> copyFrom,
- <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>[] names)
- throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre>
- <div class="block">Creates a new <code>JSONObject</code> by copying mappings for the listed names
- from the given object. Names that aren't present in <code>copyFrom</code> will
- be skipped.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>copyFrom</code> - The source object.</dd>
- <dd><code>names</code> - The names of the fields to copy.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - On internal errors. Shouldn't happen.</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>
- <div class="block">Returns the number of name/value mappings in this object.</div>
- <dl>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>the length of this.</dd>
- </dl>
- </li>
- </ul>
- <a name="put-java.lang.String-boolean-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>put</h4>
- <pre>public <a href="../twitter4j/JSONObject.html" title="class in twitter4j">JSONObject</a> put(<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> name,
- boolean value)
- throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre>
- <div class="block">Maps <code>name</code> to <code>value</code>, clobbering any existing name/value
- mapping with the same name.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name of the value to insert.</dd>
- <dd><code>value</code> - The value to insert.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>this 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="put-java.lang.String-double-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>put</h4>
- <pre>public <a href="../twitter4j/JSONObject.html" title="class in twitter4j">JSONObject</a> put(<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> name,
- double value)
- throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre>
- <div class="block">Maps <code>name</code> to <code>value</code>, clobbering any existing name/value
- mapping with the same name.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name for the new 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 object.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - if value is NaN or infinite.</dd>
- </dl>
- </li>
- </ul>
- <a name="put-java.lang.String-int-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>put</h4>
- <pre>public <a href="../twitter4j/JSONObject.html" title="class in twitter4j">JSONObject</a> put(<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> name,
- int value)
- throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre>
- <div class="block">Maps <code>name</code> to <code>value</code>, clobbering any existing name/value
- mapping with the same name.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name for the new value.</dd>
- <dd><code>value</code> - The new value.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>this 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="put-java.lang.String-long-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>put</h4>
- <pre>public <a href="../twitter4j/JSONObject.html" title="class in twitter4j">JSONObject</a> put(<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> name,
- long value)
- throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre>
- <div class="block">Maps <code>name</code> to <code>value</code>, clobbering any existing name/value
- mapping with the same name.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name of the new value.</dd>
- <dd><code>value</code> - The new value to insert.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>this 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="put-java.lang.String-java.lang.Object-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>put</h4>
- <pre>public <a href="../twitter4j/JSONObject.html" title="class in twitter4j">JSONObject</a> put(<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> name,
- <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">Maps <code>name</code> to <code>value</code>, clobbering any existing name/value
- mapping with the same name. If the value is <code>null</code>, any existing
- mapping for <code>name</code> is removed.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name of the new 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>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 object.</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 an invalid double (infinite or NaN).</dd>
- </dl>
- </li>
- </ul>
- <a name="putOpt-java.lang.String-java.lang.Object-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>putOpt</h4>
- <pre>public <a href="../twitter4j/JSONObject.html" title="class in twitter4j">JSONObject</a> putOpt(<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> name,
- <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">Equivalent to <code>put(name, value)</code> when both parameters are non-null;
- does nothing otherwise.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name of the value to insert.</dd>
- <dd><code>value</code> - The value to insert.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>this object.</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 an invalid double (infinite or NaN).</dd>
- </dl>
- </li>
- </ul>
- <a name="accumulate-java.lang.String-java.lang.Object-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>accumulate</h4>
- <pre>public <a href="../twitter4j/JSONObject.html" title="class in twitter4j">JSONObject</a> accumulate(<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> name,
- <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">Appends <code>value</code> to the array already mapped to <code>name</code>. If
- this object has no mapping for <code>name</code>, this inserts a new mapping.
- If the mapping exists but its value is not an array, the existing
- and new values are inserted in order into a new array which is itself
- mapped to <code>name</code>. In aggregate, this allows values to be added to a
- mapping one at a time.
- Note that <code>append(String, Object)</code> provides better semantics.
- In particular, the mapping for <code>name</code> will <b>always</b> be a
- <a href="../twitter4j/JSONArray.html" title="class in twitter4j"><code>JSONArray</code></a>. Using <code>accumulate</code> will result in either a
- <a href="../twitter4j/JSONArray.html" title="class in twitter4j"><code>JSONArray</code></a> or a mapping whose type is the type of <code>value</code>
- depending on the number of calls to it.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name of the field to change.</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>NULL</code></a> or null. 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 object after mutation.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - If the object being added is an invalid number.</dd>
- </dl>
- </li>
- </ul>
- <a name="append-java.lang.String-java.lang.Object-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>append</h4>
- <pre>public <a href="../twitter4j/JSONObject.html" title="class in twitter4j">JSONObject</a> append(<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> name,
- <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">Appends values to the array mapped to <code>name</code>. A new <a href="../twitter4j/JSONArray.html" title="class in twitter4j"><code>JSONArray</code></a>
- mapping for <code>name</code> will be inserted if no mapping exists. If the existing
- mapping for <code>name</code> is not a <a href="../twitter4j/JSONArray.html" title="class in twitter4j"><code>JSONArray</code></a>, a <a href="../twitter4j/JSONException.html" title="class in twitter4j"><code>JSONException</code></a>
- will be thrown.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name of the array to which the value should be appended.</dd>
- <dd><code>value</code> - The value to append.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>this object.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - if <code>name</code> is <code>null</code> or if the mapping for
- <code>name</code> is non-null and is not a <a href="../twitter4j/JSONArray.html" title="class in twitter4j"><code>JSONArray</code></a>.</dd>
- </dl>
- </li>
- </ul>
- <a name="remove-java.lang.String-">
- <!-- -->
- </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(<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> name)</pre>
- <div class="block">Removes the named mapping if it exists; does nothing otherwise.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name of the mapping to remove.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>the value previously mapped by <code>name</code>, or null if there was
- no such mapping.</dd>
- </dl>
- </li>
- </ul>
- <a name="isNull-java.lang.String-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>isNull</h4>
- <pre>public boolean isNull(<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> name)</pre>
- <div class="block">Returns true if this object has no mapping for <code>name</code> or if it has
- a mapping whose value is <a href="../twitter4j/JSONObject.html#NULL"><code>NULL</code></a>.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name of the value to check on.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>true if the field doesn't exist or is null.</dd>
- </dl>
- </li>
- </ul>
- <a name="has-java.lang.String-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>has</h4>
- <pre>public boolean has(<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> name)</pre>
- <div class="block">Returns true if this object has a mapping for <code>name</code>. The mapping
- may be <a href="../twitter4j/JSONObject.html#NULL"><code>NULL</code></a>.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name of the value to check on.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>true if this object has a field named <code>name</code></dd>
- </dl>
- </li>
- </ul>
- <a name="get-java.lang.String-">
- <!-- -->
- </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(<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> name)
- throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre>
- <div class="block">Returns the value mapped by <code>name</code>, or throws if no such mapping exists.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name of the value to get.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>The value.</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 mapping exists.</dd>
- </dl>
- </li>
- </ul>
- <a name="opt-java.lang.String-">
- <!-- -->
- </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(<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> name)</pre>
- <div class="block">Returns the value mapped by <code>name</code>, or null if no such mapping
- exists.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name of the value to get.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>The value.</dd>
- </dl>
- </li>
- </ul>
- <a name="getBoolean-java.lang.String-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getBoolean</h4>
- <pre>public boolean getBoolean(<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> name)
- throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is a boolean or
- can be coerced to a boolean, or throws otherwise.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name of the field we want.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>The selected value if it exists.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - if the mapping doesn't exist or cannot be coerced
- to a boolean.</dd>
- </dl>
- </li>
- </ul>
- <a name="optBoolean-java.lang.String-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>optBoolean</h4>
- <pre>public boolean optBoolean(<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> name)</pre>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is a boolean or
- can be coerced to a boolean, or false otherwise.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name of the field we want.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>The selected value if it exists.</dd>
- </dl>
- </li>
- </ul>
- <a name="optBoolean-java.lang.String-boolean-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>optBoolean</h4>
- <pre>public boolean optBoolean(<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> name,
- boolean fallback)</pre>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is a boolean or
- can be coerced to a boolean, or <code>fallback</code> otherwise.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name of the field we want.</dd>
- <dd><code>fallback</code> - The value to return if the field isn't there.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>The selected value or the fallback.</dd>
- </dl>
- </li>
- </ul>
- <a name="getDouble-java.lang.String-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getDouble</h4>
- <pre>public double getDouble(<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> name)
- throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is a double or
- can be coerced to a double, or throws otherwise.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name of the field we want.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>The selected value if it exists.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - if the mapping doesn't exist or cannot be coerced
- to a double.</dd>
- </dl>
- </li>
- </ul>
- <a name="optDouble-java.lang.String-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>optDouble</h4>
- <pre>public double optDouble(<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> name)</pre>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is a double or
- can be coerced to a double, or <code>NaN</code> otherwise.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name of the field we want.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>The selected value if it exists.</dd>
- </dl>
- </li>
- </ul>
- <a name="optDouble-java.lang.String-double-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>optDouble</h4>
- <pre>public double optDouble(<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> name,
- double fallback)</pre>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is a double or
- can be coerced to a double, or <code>fallback</code> otherwise.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name of the field we want.</dd>
- <dd><code>fallback</code> - The value to return if the field isn't there.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>The selected value or the fallback.</dd>
- </dl>
- </li>
- </ul>
- <a name="getInt-java.lang.String-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getInt</h4>
- <pre>public int getInt(<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> name)
- throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is an int or
- can be coerced to an int, or throws otherwise.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name of the field we want.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>The selected value if it exists.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - if the mapping doesn't exist or cannot be coerced
- to an int.</dd>
- </dl>
- </li>
- </ul>
- <a name="optInt-java.lang.String-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>optInt</h4>
- <pre>public int optInt(<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> name)</pre>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is an int or
- can be coerced to an int, or 0 otherwise.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name of the field we want.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>The selected value if it exists.</dd>
- </dl>
- </li>
- </ul>
- <a name="optInt-java.lang.String-int-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>optInt</h4>
- <pre>public int optInt(<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> name,
- int fallback)</pre>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is an int or
- can be coerced to an int, or <code>fallback</code> otherwise.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name of the field we want.</dd>
- <dd><code>fallback</code> - The value to return if the field isn't there.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>The selected value or the fallback.</dd>
- </dl>
- </li>
- </ul>
- <a name="getLong-java.lang.String-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getLong</h4>
- <pre>public long getLong(<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> name)
- throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is a long or
- can be coerced to a long, or throws otherwise.
- Note that JSON represents numbers as doubles,
- so this is <a href="#lossy">lossy</a>; use strings to transfer numbers
- via JSON without loss.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name of the field that we want.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>The value of the field.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - if the mapping doesn't exist or cannot be coerced
- to a long.</dd>
- </dl>
- </li>
- </ul>
- <a name="optLong-java.lang.String-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>optLong</h4>
- <pre>public long optLong(<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> name)</pre>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is a long or
- can be coerced to a long, or 0 otherwise. Note that JSON represents numbers as doubles,
- so this is <a href="#lossy">lossy</a>; use strings to transfer numbers via JSON.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name of the field we want.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>The selected value.</dd>
- </dl>
- </li>
- </ul>
- <a name="optLong-java.lang.String-long-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>optLong</h4>
- <pre>public long optLong(<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> name,
- long fallback)</pre>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is a long or
- can be coerced to a long, or <code>fallback</code> otherwise. Note that JSON represents
- numbers as doubles, so this is <a href="#lossy">lossy</a>; use strings to transfer
- numbers via JSON.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name of the field we want.</dd>
- <dd><code>fallback</code> - The value to return if the field isn't there.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>The selected value or the fallback.</dd>
- </dl>
- </li>
- </ul>
- <a name="getString-java.lang.String-">
- <!-- -->
- </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(<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> name)
- throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre>
- <div class="block">Returns the value mapped by <code>name</code> if it exists, coercing it if
- necessary, or throws if no such mapping exists.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name of the field we want.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>The value of the field.</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 mapping exists.</dd>
- </dl>
- </li>
- </ul>
- <a name="optString-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(<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> name)</pre>
- <div class="block">Returns the value mapped by <code>name</code> if it exists, coercing it if
- necessary, or the empty string if no such mapping exists.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name of the field we want.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>The value of the field.</dd>
- </dl>
- </li>
- </ul>
- <a name="optString-java.lang.String-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(<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> name,
- <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 mapped by <code>name</code> if it exists, coercing it if
- necessary, or <code>fallback</code> if no such mapping exists.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name of the field that we want.</dd>
- <dd><code>fallback</code> - The value to return if the field doesn't exist.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>The value of the field or fallback.</dd>
- </dl>
- </li>
- </ul>
- <a name="getJSONArray-java.lang.String-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getJSONArray</h4>
- <pre>public <a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a> getJSONArray(<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> name)
- throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is a <code>JSONArray</code>, or throws otherwise.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The field we want to get.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>The value of the field (if it is a JSONArray.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - if the mapping doesn't exist or is not a <code>JSONArray</code>.</dd>
- </dl>
- </li>
- </ul>
- <a name="optJSONArray-java.lang.String-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>optJSONArray</h4>
- <pre>public <a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a> optJSONArray(<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> name)</pre>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is a <code>JSONArray</code>, or null otherwise.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name of the field we want.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>The value of the specified field (assuming it is a JSNOArray</dd>
- </dl>
- </li>
- </ul>
- <a name="getJSONObject-java.lang.String-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>getJSONObject</h4>
- <pre>public <a href="../twitter4j/JSONObject.html" title="class in twitter4j">JSONObject</a> getJSONObject(<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> name)
- throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is a <code>JSONObject</code>, or throws otherwise.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name of the field that we want.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>a specified field value (if it is a JSONObject)</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - if the mapping doesn't exist or is not a <code>JSONObject</code>.</dd>
- </dl>
- </li>
- </ul>
- <a name="optJSONObject-java.lang.String-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>optJSONObject</h4>
- <pre>public <a href="../twitter4j/JSONObject.html" title="class in twitter4j">JSONObject</a> optJSONObject(<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> name)</pre>
- <div class="block">Returns the value mapped by <code>name</code> if it exists and is a <code>JSONObject</code>, or null otherwise.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>name</code> - The name of the value we want.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>The specified value.</dd>
- </dl>
- </li>
- </ul>
- <a name="toJSONArray-twitter4j.JSONArray-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>toJSONArray</h4>
- <pre>public <a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a> toJSONArray(<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 an array with the values corresponding to <code>names</code>. The
- array contains null for names that aren't mapped. This method returns
- null if <code>names</code> is either null or empty.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>names</code> - The names of the fields that we want the values for.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>The selected values.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - On internal errors. Shouldn't happen.</dd>
- </dl>
- </li>
- </ul>
- <a name="keys--">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>keys</h4>
- <pre>public <a href="http://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</a><<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>> keys()</pre>
- <div class="block">Returns an iterator of the <code>String</code> names in this object. The
- returned iterator supports <a href="http://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html?is-external=true#remove--" title="class or interface in java.util"><code>remove</code></a>, which will
- remove the corresponding mapping from this object. If this object is
- modified after the iterator is returned, the iterator's behavior is
- undefined. The order of the keys is undefined.</div>
- <dl>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>an iterator over the keys.</dd>
- </dl>
- </li>
- </ul>
- <a name="keySet--">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>keySet</h4>
- <pre>public <a href="http://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a><<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>> keySet()</pre>
- <div class="block">Returns the set of <code>String</code> names in this object. The returned set
- is a view of the keys in this object. <a href="http://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true#remove-java.lang.Object-" title="class or interface in java.util"><code>Set.remove(Object)</code></a> will remove
- the corresponding mapping from this object and set iterator behaviour
- is undefined if this object is modified after it is returned.
- See <a href="../twitter4j/JSONObject.html#keys--"><code>keys()</code></a>.</div>
- <dl>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>The names in this object.</dd>
- </dl>
- </li>
- </ul>
- <a name="names--">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>names</h4>
- <pre>public <a href="../twitter4j/JSONArray.html" title="class in twitter4j">JSONArray</a> names()</pre>
- <div class="block">Returns an array containing the string names in this object. This method
- returns null if this object contains no mappings.</div>
- <dl>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>the names.</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 object as a compact JSON string, such as:
- <pre>{"query":"Pizza","locations":[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>
- </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 object as a human readable JSON string for debugging, such
- as:
- <pre>
- {
- "query": "Pizza",
- "locations": [
- 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 containing the pretty form of this.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - On internal errors. Shouldn't happen.</dd>
- </dl>
- </li>
- </ul>
- <a name="numberToString-java.lang.Number-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>numberToString</h4>
- <pre>public static <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> numberToString(<a href="http://docs.oracle.com/javase/8/docs/api/java/lang/Number.html?is-external=true" title="class or interface in java.lang">Number</a> number)
- throws <a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></pre>
- <div class="block">Encodes the number as a JSON string.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>number</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>The encoded number in string form.</dd>
- <dt><span class="throwsLabel">Throws:</span></dt>
- <dd><code><a href="../twitter4j/JSONException.html" title="class in twitter4j">JSONException</a></code> - On internal errors. Shouldn't happen.</dd>
- </dl>
- </li>
- </ul>
- <a name="quote-java.lang.String-">
- <!-- -->
- </a>
- <ul class="blockList">
- <li class="blockList">
- <h4>quote</h4>
- <pre>public static <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> quote(<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> data)</pre>
- <div class="block">Encodes <code>data</code> as a JSON string. This applies quotes and any
- necessary character escaping.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>data</code> - the string to encode. Null will be interpreted as an empty
- string.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>the quoted string.</dd>
- </dl>
- </li>
- </ul>
- <a name="wrap-java.lang.Object-">
- <!-- -->
- </a>
- <ul class="blockListLast">
- <li class="blockList">
- <h4>wrap</h4>
- <pre>public static <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> wrap(<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>
- <div class="block">Wraps the given object if necessary.
- <p>If the object is null or , returns <a href="../twitter4j/JSONObject.html#NULL"><code>NULL</code></a>.
- If the object is a <code>JSONArray</code> or <code>JSONObject</code>, no wrapping is necessary.
- If the object is <code>NULL</code>, no wrapping is necessary.
- If the object is an array or <code>Collection</code>, returns an equivalent <code>JSONArray</code>.
- If the object is a <code>Map</code>, returns an equivalent <code>JSONObject</code>.
- If the object is a primitive wrapper type or <code>String</code>, returns the object.
- Otherwise if the object is from a <code>java</code> package, returns the result of <code>toString</code>.
- If wrapping fails, returns null.</div>
- <dl>
- <dt><span class="paramLabel">Parameters:</span></dt>
- <dd><code>o</code> - The object to wrap.</dd>
- <dt><span class="returnLabel">Returns:</span></dt>
- <dd>The wrapped (if necessary) form of the object {$code o}</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/JSONObject.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/JSONException.html" title="class in twitter4j"><span class="typeNameLink">Prev Class</span></a></li>
- <li><a href="../twitter4j/JSONObjectType.html" title="class in twitter4j"><span class="typeNameLink">Next Class</span></a></li>
- </ul>
- <ul class="navList">
- <li><a href="../index.html?twitter4j/JSONObject.html" target="_top">Frames</a></li>
- <li><a href="JSONObject.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><a href="#field.summary">Field</a> | </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><a href="#field.detail">Field</a> | </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>
|