@@ -91,6 +91,7 @@ of this software and associated documentation files (the "Software"), to deal
9191 *
9292 * @author JSON.org
9393 * @version 2012-11-13
94+ * @webref data:composite
9495 */
9596public class JSONArray {
9697
@@ -258,6 +259,8 @@ private Object get(int index) {
258259 * @param index The index must be between 0 and length() - 1.
259260 * @return A string value.
260261 * @throws JSONException If there is no string value for the index.
262+ * @webref jsonarray:method
263+ * @brief Get the string associated with an index
261264 */
262265 public String getString (int index ) {
263266 Object object = this .get (index );
@@ -274,6 +277,8 @@ public String getString(int index) {
274277 * @param index The index must be between 0 and length() - 1.
275278 * @return The value.
276279 * @throws JSONException If the key is not found or if the value is not a number.
280+ * @webref jsonarray:method
281+ * @brief Get the int value associated with an index
277282 */
278283 public int getInt (int index ) {
279284 Object object = this .get (index );
@@ -310,6 +315,9 @@ public long getLong(int index) {
310315 /**
311316 * Get a value from an index as a float. JSON uses 'double' values
312317 * internally, so this is simply getDouble() cast to a float.
318+ *
319+ * @webref jsonarray:method
320+ * @brief To come...
313321 */
314322 public float getFloat (int index ) {
315323 return (float ) getDouble (index );
@@ -344,6 +352,8 @@ public double getDouble(int index) {
344352 * @return The truth.
345353 * @throws JSONException If there is no value for the index or if the
346354 * value is not convertible to boolean.
355+ * @webref jsonarray:method
356+ * @brief Get the boolean value associated with an index
347357 */
348358 public boolean getBoolean (int index ) {
349359 Object object = this .get (index );
@@ -362,10 +372,13 @@ public boolean getBoolean(int index) {
362372
363373 /**
364374 * Get the JSONArray associated with an index.
375+ *
365376 * @param index The index must be between 0 and length() - 1.
366377 * @return A JSONArray value.
367378 * @throws JSONException If there is no value for the index. or if the
368379 * value is not a JSONArray
380+ * @webref jsonarray:method
381+ * @brief Get the JSONArray associated with an index
369382 */
370383 public JSONArray getJSONArray (int index ) {
371384 Object object = this .get (index );
@@ -378,10 +391,13 @@ public JSONArray getJSONArray(int index) {
378391
379392 /**
380393 * Get the JSONObject associated with an index.
394+ *
381395 * @param index subscript
382396 * @return A JSONObject value.
383397 * @throws JSONException If there is no value for the index or if the
384398 * value is not a JSONObject
399+ * @webref jsonarray:method
400+ * @brief Get the JSONObject associated with an index
385401 */
386402 public JSONObject getJSONObject (int index ) {
387403 Object object = this .get (index );
@@ -392,7 +408,12 @@ public JSONObject getJSONObject(int index) {
392408 }
393409
394410
395- /** Get this entire array as a String array. */
411+ /**
412+ * Get this entire array as a String array.
413+ *
414+ * @webref jsonarray:method
415+ * @brief Get this entire array as a String array
416+ */
396417 public String [] getStringArray () {
397418 String [] outgoing = new String [size ()];
398419 for (int i = 0 ; i < size (); i ++) {
@@ -402,7 +423,12 @@ public String[] getStringArray() {
402423 }
403424
404425
405- /** Get this entire array as an int array. Everything must be an int. */
426+ /**
427+ * Get this entire array as an int array. Everything must be an int.
428+ *
429+ * @webref jsonarray:method
430+ * @brief Get this entire array as an int array
431+ */
406432 public int [] getIntArray () {
407433 int [] outgoing = new int [size ()];
408434 for (int i = 0 ; i < size (); i ++) {
@@ -634,6 +660,8 @@ public boolean[] getBooleanArray() {
634660 *
635661 * @param value A String value.
636662 * @return this.
663+ * @webref jsonarray:method
664+ * @brief Append an String value. This increases the array's length by one.
637665 */
638666 public JSONArray append (String value ) {
639667 this .append ((Object )value );
@@ -777,6 +805,8 @@ protected JSONArray append(Object value) {
777805 * @param value A String value.
778806 * @return this.
779807 * @throws JSONException If the index is negative.
808+ * @webref jsonarray:method
809+ * @brief Put or replace a String value
780810 */
781811 public JSONArray setString (int index , String value ) {
782812 this .set (index , value );
@@ -792,6 +822,8 @@ public JSONArray setString(int index, String value) {
792822 * @param value An int value.
793823 * @return this.
794824 * @throws JSONException If the index is negative.
825+ * @webref jsonarray:method
826+ * @brief Put or replace an int value
795827 */
796828 public JSONArray setInt (int index , int value ) {
797829 this .set (index , new Integer (value ));
@@ -823,6 +855,8 @@ public JSONArray setLong(int index, long value) {
823855 * @return this.
824856 * @throws RuntimeException If the index is negative or if the value is
825857 * not finite.
858+ * @webref jsonarray:method
859+ * @brief Put or replace a float value
826860 */
827861 public JSONArray setFloat (int index , float value ) {
828862 return setDouble (index , value );
@@ -852,6 +886,8 @@ public JSONArray setDouble(int index, double value) {
852886 * @param value A boolean value.
853887 * @return this.
854888 * @throws JSONException If the index is negative.
889+ * @webref jsonarray:method
890+ * @brief Put or replace a boolean value
855891 */
856892 public JSONArray setBoolean (int index , boolean value ) {
857893 return set (index , value ? Boolean .TRUE : Boolean .FALSE );
@@ -872,13 +908,19 @@ public JSONArray setBoolean(int index, boolean value) {
872908// return this;
873909// }
874910
875-
911+ /**
912+ * @webref jsonarray:method
913+ * @brief To come...
914+ */
876915 public JSONArray setJSONArray (int index , JSONArray value ) {
877916 set (index , value );
878917 return this ;
879918 }
880919
881-
920+ /**
921+ * @webref jsonarray:method
922+ * @brief To come...
923+ */
882924 public JSONArray setJSONObject (int index , JSONObject value ) {
883925 set (index , value );
884926 return this ;
@@ -918,6 +960,8 @@ private JSONArray set(int index, Object value) {
918960 * Get the number of elements in the JSONArray, included nulls.
919961 *
920962 * @return The length (or size).
963+ * @webref jsonarray:method
964+ * @brief Get the number of elements in the JSONArray, included nulls
921965 */
922966 public int size () {
923967 return myArrayList .size ();
@@ -937,9 +981,12 @@ protected boolean isNull(int index) {
937981
938982 /**
939983 * Remove an index and close the hole.
984+ *
940985 * @param index The index of the element to be removed.
941986 * @return The value that was associated with the index,
942987 * or null if there was no value.
988+ * @webref jsonarray:method
989+ * @brief Remove an index and close the hole
943990 */
944991 public Object remove (int index ) {
945992 Object o = this .opt (index );
0 commit comments