forked from stleary/JSON-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJSONObject.html
More file actions
2197 lines (2191 loc) · 94.1 KB
/
JSONObject.html
File metadata and controls
2197 lines (2191 loc) · 94.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="de">
<head>
<!-- Generated by javadoc (1.8.0_05) on Sun Feb 14 02:15:50 CET 2016 -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSONObject (JSON in Java 20160212 API)</title>
<meta name="date" content="2016-02-14">
<link rel="stylesheet" type="text/css" href="../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="JSONObject (JSON in Java 20160212 API)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":9,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":9,"i14":9,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":9,"i24":10,"i25":10,"i26":10,"i27":10,"i28":10,"i29":10,"i30":10,"i31":10,"i32":10,"i33":10,"i34":10,"i35":10,"i36":10,"i37":10,"i38":10,"i39":10,"i40":10,"i41":10,"i42":10,"i43":10,"i44":10,"i45":10,"i46":10,"i47":10,"i48":10,"i49":10,"i50":9,"i51":9,"i52":10,"i53":10,"i54":9,"i55":9,"i56":10,"i57":10,"i58":10,"i59":9,"i60":9,"i61":10,"i62":10};
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="../../org/json/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="../../org/json/JSONML.html" title="class in org.json"><span class="typeNameLink">Prev Class</span></a></li>
<li><a href="../../org/json/JSONString.html" title="interface in org.json"><span class="typeNameLink">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?org/json/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">org.json</div>
<h2 title="Class JSONObject" class="title">Class JSONObject</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li>org.json.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 java.lang.Object</pre>
<div class="block">A JSONObject is an unordered collection of name/value pairs. Its external
form is a string wrapped in curly braces with colons between the names and
values, and commas between the values and names. The internal form is an
object having <code>get</code> and <code>opt</code> methods for accessing
the values by name, and <code>put</code> methods for adding or replacing
values by name. The values can be any of these types: <code>Boolean</code>,
<code>JSONArray</code>, <code>JSONObject</code>, <code>Number</code>,
<code>String</code>, or the <code>JSONObject.NULL</code> object. A
JSONObject constructor can be used to convert an external form JSON text
into an internal form whose values can be retrieved with the
<code>get</code> and <code>opt</code> methods, or to convert values into a
JSON text using the <code>put</code> and <code>toString</code> methods. A
<code>get</code> method returns a value if one can be found, and throws an
exception if one cannot be found. An <code>opt</code> method returns a
default value instead of throwing an exception, and so is useful for
obtaining optional values.
<p>
The generic <code>get()</code> and <code>opt()</code> methods return an
object, which you can cast or query for type. There are also typed
<code>get</code> and <code>opt</code> methods that do type checking and type
coercion for you. The opt methods differ from the get methods in that they
do not throw. Instead, they return a specified value, such as null.
<p>
The <code>put</code> methods add or replace values in an object. For
example,
<pre>
myString = new JSONObject()
.put("JSON", "Hello, World!").toString();
</pre>
produces the string <code>{"JSON": "Hello, World"}</code>.
<p>
The texts produced by the <code>toString</code> methods strictly conform to
the JSON syntax rules. The constructors are more forgiving in the texts they
will accept:
<ul>
<li>An extra <code>,</code> <small>(comma)</small> may appear just
before the closing brace.</li>
<li>Strings may be quoted with <code>'</code> <small>(single
quote)</small>.</li>
<li>Strings do not need to be quoted at all if they do not begin with a
quote or single quote, and if they do not contain leading or trailing
spaces, and if they do not contain any of these characters:
<code>{ } [ ] / \ : , #</code> and if they do not look like numbers and
if they are not the reserved words <code>true</code>, <code>false</code>,
or <code>null</code>.</li>
</ul></div>
<dl>
<dt><span class="simpleTagLabel">Version:</span></dt>
<dd>2016-02-08</dd>
<dt><span class="simpleTagLabel">Author:</span></dt>
<dd>JSON.org</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== 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 java.lang.Object</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#NULL">NULL</a></span></code>
<div class="block">It is sometimes more convenient and less ambiguous to have a
<code>NULL</code> object than to use Java's <code>null</code> 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="../../org/json/JSONObject.html#JSONObject--">JSONObject</a></span>()</code>
<div class="block">Construct an empty JSONObject.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#JSONObject-org.json.JSONObject-java.lang.String:A-">JSONObject</a></span>(<a href="../../org/json/JSONObject.html" title="class in org.json">JSONObject</a> jo,
java.lang.String[] names)</code>
<div class="block">Construct a JSONObject from a subset of another JSONObject.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#JSONObject-org.json.JSONTokener-">JSONObject</a></span>(<a href="../../org/json/JSONTokener.html" title="class in org.json">JSONTokener</a> x)</code>
<div class="block">Construct a JSONObject from a JSONTokener.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#JSONObject-java.util.Map-">JSONObject</a></span>(java.util.Map<?,?> map)</code>
<div class="block">Construct a JSONObject from a Map.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#JSONObject-java.lang.Object-">JSONObject</a></span>(java.lang.Object bean)</code>
<div class="block">Construct a JSONObject from an Object using bean getters.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#JSONObject-java.lang.Object-java.lang.String:A-">JSONObject</a></span>(java.lang.Object object,
java.lang.String[] names)</code>
<div class="block">Construct a JSONObject from an Object, using reflection to find the
public members.</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#JSONObject-java.lang.String-">JSONObject</a></span>(java.lang.String source)</code>
<div class="block">Construct a JSONObject from a source JSON text string.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#JSONObject-java.lang.String-java.util.Locale-">JSONObject</a></span>(java.lang.String baseName,
java.util.Locale locale)</code>
<div class="block">Construct a JSONObject from a ResourceBundle.</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="../../org/json/JSONObject.html" title="class in org.json">JSONObject</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#accumulate-java.lang.String-java.lang.Object-">accumulate</a></span>(java.lang.String key,
java.lang.Object value)</code>
<div class="block">Accumulate values under a key.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code><a href="../../org/json/JSONObject.html" title="class in org.json">JSONObject</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#append-java.lang.String-java.lang.Object-">append</a></span>(java.lang.String key,
java.lang.Object value)</code>
<div class="block">Append values to the array under a key.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>static java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#doubleToString-double-">doubleToString</a></span>(double d)</code>
<div class="block">Produce a string from a double.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>java.lang.Object</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#get-java.lang.String-">get</a></span>(java.lang.String key)</code>
<div class="block">Get the value object associated with a key.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>java.math.BigDecimal</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#getBigDecimal-java.lang.String-">getBigDecimal</a></span>(java.lang.String key)</code>
<div class="block">Get the BigDecimal value associated with a key.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>java.math.BigInteger</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#getBigInteger-java.lang.String-">getBigInteger</a></span>(java.lang.String key)</code>
<div class="block">Get the BigInteger value associated with a key.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#getBoolean-java.lang.String-">getBoolean</a></span>(java.lang.String key)</code>
<div class="block">Get the boolean value associated with a key.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#getDouble-java.lang.String-">getDouble</a></span>(java.lang.String key)</code>
<div class="block">Get the double value associated with a key.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code><E extends java.lang.Enum<E>><br>E</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#getEnum-java.lang.Class-java.lang.String-">getEnum</a></span>(java.lang.Class<E> clazz,
java.lang.String key)</code>
<div class="block">Get the enum value associated with a key.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#getInt-java.lang.String-">getInt</a></span>(java.lang.String key)</code>
<div class="block">Get the int value associated with a key.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code><a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#getJSONArray-java.lang.String-">getJSONArray</a></span>(java.lang.String key)</code>
<div class="block">Get the JSONArray value associated with a key.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code><a href="../../org/json/JSONObject.html" title="class in org.json">JSONObject</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#getJSONObject-java.lang.String-">getJSONObject</a></span>(java.lang.String key)</code>
<div class="block">Get the JSONObject value associated with a key.</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#getLong-java.lang.String-">getLong</a></span>(java.lang.String key)</code>
<div class="block">Get the long value associated with a key.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>static java.lang.String[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#getNames-org.json.JSONObject-">getNames</a></span>(<a href="../../org/json/JSONObject.html" title="class in org.json">JSONObject</a> jo)</code>
<div class="block">Get an array of field names from a JSONObject.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code>static java.lang.String[]</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#getNames-java.lang.Object-">getNames</a></span>(java.lang.Object object)</code>
<div class="block">Get an array of field names from an Object.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#getString-java.lang.String-">getString</a></span>(java.lang.String key)</code>
<div class="block">Get the string associated with a key.</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#has-java.lang.String-">has</a></span>(java.lang.String key)</code>
<div class="block">Determine if the JSONObject contains a specific key.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code><a href="../../org/json/JSONObject.html" title="class in org.json">JSONObject</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#increment-java.lang.String-">increment</a></span>(java.lang.String key)</code>
<div class="block">Increment a property of a JSONObject.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#isNull-java.lang.String-">isNull</a></span>(java.lang.String key)</code>
<div class="block">Determine if the value associated with the key is null or if there is no
value.</div>
</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>java.util.Iterator<java.lang.String></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#keys--">keys</a></span>()</code>
<div class="block">Get an enumeration of the keys of the JSONObject.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>java.util.Set<java.lang.String></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#keySet--">keySet</a></span>()</code>
<div class="block">Get a set of keys of the JSONObject.</div>
</td>
</tr>
<tr id="i21" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#length--">length</a></span>()</code>
<div class="block">Get the number of keys stored in the JSONObject.</div>
</td>
</tr>
<tr id="i22" class="altColor">
<td class="colFirst"><code><a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#names--">names</a></span>()</code>
<div class="block">Produce a JSONArray containing the names of the elements of this
JSONObject.</div>
</td>
</tr>
<tr id="i23" class="rowColor">
<td class="colFirst"><code>static java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#numberToString-java.lang.Number-">numberToString</a></span>(java.lang.Number number)</code>
<div class="block">Produce a string from a Number.</div>
</td>
</tr>
<tr id="i24" class="altColor">
<td class="colFirst"><code>java.lang.Object</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#opt-java.lang.String-">opt</a></span>(java.lang.String key)</code>
<div class="block">Get an optional value associated with a key.</div>
</td>
</tr>
<tr id="i25" class="rowColor">
<td class="colFirst"><code>java.math.BigDecimal</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#optBigDecimal-java.lang.String-java.math.BigDecimal-">optBigDecimal</a></span>(java.lang.String key,
java.math.BigDecimal defaultValue)</code>
<div class="block">Get an optional BigDecimal associated with a key, or the defaultValue if
there is no such key or if its value is not a number.</div>
</td>
</tr>
<tr id="i26" class="altColor">
<td class="colFirst"><code>java.math.BigInteger</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#optBigInteger-java.lang.String-java.math.BigInteger-">optBigInteger</a></span>(java.lang.String key,
java.math.BigInteger defaultValue)</code>
<div class="block">Get an optional BigInteger associated with a key, or the defaultValue if
there is no such key or if its value is not a number.</div>
</td>
</tr>
<tr id="i27" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#optBoolean-java.lang.String-">optBoolean</a></span>(java.lang.String key)</code>
<div class="block">Get an optional boolean associated with a key.</div>
</td>
</tr>
<tr id="i28" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#optBoolean-java.lang.String-boolean-">optBoolean</a></span>(java.lang.String key,
boolean defaultValue)</code>
<div class="block">Get an optional boolean associated with a key.</div>
</td>
</tr>
<tr id="i29" class="rowColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#optDouble-java.lang.String-">optDouble</a></span>(java.lang.String key)</code>
<div class="block">Get an optional double associated with a key, or NaN if there is no such
key or if its value is not a number.</div>
</td>
</tr>
<tr id="i30" class="altColor">
<td class="colFirst"><code>double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#optDouble-java.lang.String-double-">optDouble</a></span>(java.lang.String key,
double defaultValue)</code>
<div class="block">Get an optional double associated with a key, or the defaultValue if
there is no such key or if its value is not a number.</div>
</td>
</tr>
<tr id="i31" class="rowColor">
<td class="colFirst"><code><E extends java.lang.Enum<E>><br>E</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#optEnum-java.lang.Class-java.lang.String-">optEnum</a></span>(java.lang.Class<E> clazz,
java.lang.String key)</code>
<div class="block">Get the enum value associated with a key.</div>
</td>
</tr>
<tr id="i32" class="altColor">
<td class="colFirst"><code><E extends java.lang.Enum<E>><br>E</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#optEnum-java.lang.Class-java.lang.String-E-">optEnum</a></span>(java.lang.Class<E> clazz,
java.lang.String key,
E defaultValue)</code>
<div class="block">Get the enum value associated with a key.</div>
</td>
</tr>
<tr id="i33" class="rowColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#optInt-java.lang.String-">optInt</a></span>(java.lang.String key)</code>
<div class="block">Get an optional int value associated with a key, or zero if there is no
such key or if the value is not a number.</div>
</td>
</tr>
<tr id="i34" class="altColor">
<td class="colFirst"><code>int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#optInt-java.lang.String-int-">optInt</a></span>(java.lang.String key,
int defaultValue)</code>
<div class="block">Get an optional int value associated with a key, or the default if there
is no such key or if the value is not a number.</div>
</td>
</tr>
<tr id="i35" class="rowColor">
<td class="colFirst"><code><a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#optJSONArray-java.lang.String-">optJSONArray</a></span>(java.lang.String key)</code>
<div class="block">Get an optional JSONArray associated with a key.</div>
</td>
</tr>
<tr id="i36" class="altColor">
<td class="colFirst"><code><a href="../../org/json/JSONObject.html" title="class in org.json">JSONObject</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#optJSONObject-java.lang.String-">optJSONObject</a></span>(java.lang.String key)</code>
<div class="block">Get an optional JSONObject associated with a key.</div>
</td>
</tr>
<tr id="i37" class="rowColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#optLong-java.lang.String-">optLong</a></span>(java.lang.String key)</code>
<div class="block">Get an optional long value associated with a key, or zero if there is no
such key or if the value is not a number.</div>
</td>
</tr>
<tr id="i38" class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#optLong-java.lang.String-long-">optLong</a></span>(java.lang.String key,
long defaultValue)</code>
<div class="block">Get an optional long value associated with a key, or the default if there
is no such key or if the value is not a number.</div>
</td>
</tr>
<tr id="i39" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#optString-java.lang.String-">optString</a></span>(java.lang.String key)</code>
<div class="block">Get an optional string associated with a key.</div>
</td>
</tr>
<tr id="i40" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#optString-java.lang.String-java.lang.String-">optString</a></span>(java.lang.String key,
java.lang.String defaultValue)</code>
<div class="block">Get an optional string associated with a key.</div>
</td>
</tr>
<tr id="i41" class="rowColor">
<td class="colFirst"><code><a href="../../org/json/JSONObject.html" title="class in org.json">JSONObject</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#put-java.lang.String-boolean-">put</a></span>(java.lang.String key,
boolean value)</code>
<div class="block">Put a key/boolean pair in the JSONObject.</div>
</td>
</tr>
<tr id="i42" class="altColor">
<td class="colFirst"><code><a href="../../org/json/JSONObject.html" title="class in org.json">JSONObject</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#put-java.lang.String-java.util.Collection-">put</a></span>(java.lang.String key,
java.util.Collection<?> value)</code>
<div class="block">Put a key/value pair in the JSONObject, where the value will be a
JSONArray which is produced from a Collection.</div>
</td>
</tr>
<tr id="i43" class="rowColor">
<td class="colFirst"><code><a href="../../org/json/JSONObject.html" title="class in org.json">JSONObject</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#put-java.lang.String-double-">put</a></span>(java.lang.String key,
double value)</code>
<div class="block">Put a key/double pair in the JSONObject.</div>
</td>
</tr>
<tr id="i44" class="altColor">
<td class="colFirst"><code><a href="../../org/json/JSONObject.html" title="class in org.json">JSONObject</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#put-java.lang.String-int-">put</a></span>(java.lang.String key,
int value)</code>
<div class="block">Put a key/int pair in the JSONObject.</div>
</td>
</tr>
<tr id="i45" class="rowColor">
<td class="colFirst"><code><a href="../../org/json/JSONObject.html" title="class in org.json">JSONObject</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#put-java.lang.String-long-">put</a></span>(java.lang.String key,
long value)</code>
<div class="block">Put a key/long pair in the JSONObject.</div>
</td>
</tr>
<tr id="i46" class="altColor">
<td class="colFirst"><code><a href="../../org/json/JSONObject.html" title="class in org.json">JSONObject</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#put-java.lang.String-java.util.Map-">put</a></span>(java.lang.String key,
java.util.Map<?,?> value)</code>
<div class="block">Put a key/value pair in the JSONObject, where the value will be a
JSONObject which is produced from a Map.</div>
</td>
</tr>
<tr id="i47" class="rowColor">
<td class="colFirst"><code><a href="../../org/json/JSONObject.html" title="class in org.json">JSONObject</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#put-java.lang.String-java.lang.Object-">put</a></span>(java.lang.String key,
java.lang.Object value)</code>
<div class="block">Put a key/value pair in the JSONObject.</div>
</td>
</tr>
<tr id="i48" class="altColor">
<td class="colFirst"><code><a href="../../org/json/JSONObject.html" title="class in org.json">JSONObject</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#putOnce-java.lang.String-java.lang.Object-">putOnce</a></span>(java.lang.String key,
java.lang.Object value)</code>
<div class="block">Put a key/value pair in the JSONObject, but only if the key and the value
are both non-null, and only if there is not already a member with that
name.</div>
</td>
</tr>
<tr id="i49" class="rowColor">
<td class="colFirst"><code><a href="../../org/json/JSONObject.html" title="class in org.json">JSONObject</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#putOpt-java.lang.String-java.lang.Object-">putOpt</a></span>(java.lang.String key,
java.lang.Object value)</code>
<div class="block">Put a key/value pair in the JSONObject, but only if the key and the value
are both non-null.</div>
</td>
</tr>
<tr id="i50" class="altColor">
<td class="colFirst"><code>static java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#quote-java.lang.String-">quote</a></span>(java.lang.String string)</code>
<div class="block">Produce a string in double quotes with backslash sequences in all the
right places.</div>
</td>
</tr>
<tr id="i51" class="rowColor">
<td class="colFirst"><code>static java.io.Writer</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#quote-java.lang.String-java.io.Writer-">quote</a></span>(java.lang.String string,
java.io.Writer w)</code> </td>
</tr>
<tr id="i52" class="altColor">
<td class="colFirst"><code>java.lang.Object</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#remove-java.lang.String-">remove</a></span>(java.lang.String key)</code>
<div class="block">Remove a name and its value, if present.</div>
</td>
</tr>
<tr id="i53" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#similar-java.lang.Object-">similar</a></span>(java.lang.Object other)</code>
<div class="block">Determine if two JSONObjects are similar.</div>
</td>
</tr>
<tr id="i54" class="altColor">
<td class="colFirst"><code>static java.lang.Object</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#stringToValue-java.lang.String-">stringToValue</a></span>(java.lang.String string)</code>
<div class="block">Try to convert a string into a number, boolean, or null.</div>
</td>
</tr>
<tr id="i55" class="rowColor">
<td class="colFirst"><code>static void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#testValidity-java.lang.Object-">testValidity</a></span>(java.lang.Object o)</code>
<div class="block">Throw an exception if the object is a NaN or infinite number.</div>
</td>
</tr>
<tr id="i56" class="altColor">
<td class="colFirst"><code><a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#toJSONArray-org.json.JSONArray-">toJSONArray</a></span>(<a href="../../org/json/JSONArray.html" title="class in org.json">JSONArray</a> names)</code>
<div class="block">Produce a JSONArray containing the values of the members of this
JSONObject.</div>
</td>
</tr>
<tr id="i57" class="rowColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#toString--">toString</a></span>()</code>
<div class="block">Make a JSON text of this JSONObject.</div>
</td>
</tr>
<tr id="i58" class="altColor">
<td class="colFirst"><code>java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#toString-int-">toString</a></span>(int indentFactor)</code>
<div class="block">Make a prettyprinted JSON text of this JSONObject.</div>
</td>
</tr>
<tr id="i59" class="rowColor">
<td class="colFirst"><code>static java.lang.String</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#valueToString-java.lang.Object-">valueToString</a></span>(java.lang.Object value)</code>
<div class="block">Make a JSON text of an Object value.</div>
</td>
</tr>
<tr id="i60" class="altColor">
<td class="colFirst"><code>static java.lang.Object</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#wrap-java.lang.Object-">wrap</a></span>(java.lang.Object object)</code>
<div class="block">Wrap an object, if necessary.</div>
</td>
</tr>
<tr id="i61" class="rowColor">
<td class="colFirst"><code>java.io.Writer</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#write-java.io.Writer-">write</a></span>(java.io.Writer writer)</code>
<div class="block">Write the contents of the JSONObject as JSON text to a writer.</div>
</td>
</tr>
<tr id="i62" class="altColor">
<td class="colFirst"><code>java.io.Writer</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../org/json/JSONObject.html#write-java.io.Writer-int-int-">write</a></span>(java.io.Writer writer,
int indentFactor,
int indent)</code>
<div class="block">Write the contents of the JSONObject as JSON text to a writer.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ 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 java.lang.Object NULL</pre>
<div class="block">It is sometimes more convenient and less ambiguous to have a
<code>NULL</code> object than to use Java's <code>null</code> value.
<code>JSONObject.NULL.equals(null)</code> returns <code>true</code>.
<code>JSONObject.NULL.toString()</code> returns <code>"null"</code>.</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">Construct an empty JSONObject.</div>
</li>
</ul>
<a name="JSONObject-org.json.JSONObject-java.lang.String:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>JSONObject</h4>
<pre>public JSONObject(<a href="../../org/json/JSONObject.html" title="class in org.json">JSONObject</a> jo,
java.lang.String[] names)</pre>
<div class="block">Construct a JSONObject from a subset of another JSONObject. An array of
strings is used to identify the keys that should be copied. Missing keys
are ignored.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>jo</code> - A JSONObject.</dd>
<dd><code>names</code> - An array of strings.</dd>
</dl>
</li>
</ul>
<a name="JSONObject-org.json.JSONTokener-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>JSONObject</h4>
<pre>public JSONObject(<a href="../../org/json/JSONTokener.html" title="class in org.json">JSONTokener</a> x)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Construct a JSONObject from a JSONTokener.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>x</code> - A JSONTokener object containing the source string.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If there is a syntax error in the source string or a
duplicated key.</dd>
</dl>
</li>
</ul>
<a name="JSONObject-java.util.Map-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>JSONObject</h4>
<pre>public JSONObject(java.util.Map<?,?> map)</pre>
<div class="block">Construct a JSONObject from a Map.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>map</code> - A map object that can be used to initialize the contents of
the JSONObject.</dd>
</dl>
</li>
</ul>
<a name="JSONObject-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>JSONObject</h4>
<pre>public JSONObject(java.lang.Object bean)</pre>
<div class="block">Construct a JSONObject from an Object using bean getters. It reflects on
all of the public methods of the object. For each of the methods with no
parameters and a name starting with <code>"get"</code> or
<code>"is"</code> followed by an uppercase letter, the method is invoked,
and a key and the value returned from the getter method are put into the
new JSONObject.
The key is formed by removing the <code>"get"</code> or <code>"is"</code>
prefix. If the second remaining character is not upper case, then the
first character is converted to lower case.
For example, if an object has a method named <code>"getName"</code>, and
if the result of calling <code>object.getName()</code> is
<code>"Larry Fine"</code>, then the JSONObject will contain
<code>"name": "Larry Fine"</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>bean</code> - An object that has getter methods that should be used to make
a JSONObject.</dd>
</dl>
</li>
</ul>
<a name="JSONObject-java.lang.Object-java.lang.String:A-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>JSONObject</h4>
<pre>public JSONObject(java.lang.Object object,
java.lang.String[] names)</pre>
<div class="block">Construct a JSONObject from an Object, using reflection to find the
public members. The resulting JSONObject's keys will be the strings from
the names array, and the values will be the field values associated with
those keys in the object. If a key is not found or not visible, then it
will not be copied into the new JSONObject.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>object</code> - An object that has fields that should be used to make a
JSONObject.</dd>
<dd><code>names</code> - An array of strings, the names of the fields to be obtained
from the object.</dd>
</dl>
</li>
</ul>
<a name="JSONObject-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>JSONObject</h4>
<pre>public JSONObject(java.lang.String source)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Construct a JSONObject from a source JSON text string. This is the most
commonly used JSONObject constructor.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>source</code> - A string beginning with <code>{</code> <small>(left
brace)</small> and ending with <code>}</code>
<small>(right brace)</small>.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If there is a syntax error in the source string or a
duplicated key.</dd>
</dl>
</li>
</ul>
<a name="JSONObject-java.lang.String-java.util.Locale-">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>JSONObject</h4>
<pre>public JSONObject(java.lang.String baseName,
java.util.Locale locale)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Construct a JSONObject from a ResourceBundle.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>baseName</code> - The ResourceBundle base name.</dd>
<dd><code>locale</code> - The Locale to load the ResourceBundle for.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If any JSONExceptions are detected.</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="accumulate-java.lang.String-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>accumulate</h4>
<pre>public <a href="../../org/json/JSONObject.html" title="class in org.json">JSONObject</a> accumulate(java.lang.String key,
java.lang.Object value)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Accumulate values under a key. It is similar to the put method except
that if there is already an object stored under the key then a JSONArray
is stored under the key to hold all of the accumulated values. If there
is already a JSONArray, then the new value is appended to it. In
contrast, the put method replaces the previous value.
If only one value is accumulated that is not a JSONArray, then the result
will be the same as using put. But if multiple values are accumulated,
then the result will be like append.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>key</code> - A key string.</dd>
<dd><code>value</code> - An object to be accumulated under the key.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If the value is an invalid number or if the key is null.</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="../../org/json/JSONObject.html" title="class in org.json">JSONObject</a> append(java.lang.String key,
java.lang.Object value)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Append values to the array under a key. If the key does not exist in the
JSONObject, then the key is put in the JSONObject with its value being a
JSONArray containing the value parameter. If the key was already
associated with a JSONArray, then the value parameter is appended to it.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>key</code> - A key string.</dd>
<dd><code>value</code> - An object to be accumulated under the key.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - If the key is null or if the current value associated with
the key is not a JSONArray.</dd>
</dl>
</li>
</ul>
<a name="doubleToString-double-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>doubleToString</h4>
<pre>public static java.lang.String doubleToString(double d)</pre>
<div class="block">Produce a string from a double. The string "null" will be returned if the
number is not finite.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>d</code> - A double.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A String.</dd>
</dl>
</li>
</ul>
<a name="get-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>get</h4>
<pre>public java.lang.Object get(java.lang.String key)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Get the value object associated with a key.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>key</code> - A key string.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The object associated with the key.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - if the key is not found.</dd>
</dl>
</li>
</ul>
<a name="getEnum-java.lang.Class-java.lang.String-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getEnum</h4>
<pre>public <E extends java.lang.Enum<E>> E getEnum(java.lang.Class<E> clazz,
java.lang.String key)
throws <a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></pre>
<div class="block">Get the enum value associated with a key.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>clazz</code> - The type of enum to retrieve.</dd>
<dd><code>key</code> - A key string.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The enum value associated with the key</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="../../org/json/JSONException.html" title="class in org.json">JSONException</a></code> - if the key is not found or if the value cannot be converted
to an enum.</dd>
</dl>
</li>
</ul>
<a name="getBoolean-java.lang.String-">
<!-- -->