Skip to content

Commit c199acc

Browse files
committed
Added related reference links to JSONArray methods
1 parent 40330cf commit c199acc

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

core/src/processing/data/JSONArray.java

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,9 @@ private Object get(int index) {
280280
* @param index must be between 0 and length() - 1
281281
* @return A string value.
282282
* @throws JSONException If there is no string value for the index.
283+
* @see JSONArray#getInt(int)
284+
* @see JSONArray#getFloat(int)
285+
* @see JSONArray#getBoolean(int)
283286
*/
284287
public String getString(int index) {
285288
Object object = this.get(index);
@@ -298,6 +301,9 @@ public String getString(int index) {
298301
* @param index must be between 0 and length() - 1
299302
* @return The value.
300303
* @throws JSONException If the key is not found or if the value is not a number.
304+
* @see JSONArray#getFloat(int)
305+
* @see JSONArray#getString(int)
306+
* @see JSONArray#getBoolean(int)
301307
*/
302308
public int getInt(int index) {
303309
Object object = this.get(index);
@@ -338,6 +344,9 @@ public long getLong(int index) {
338344
* @webref jsonarray:method
339345
* @brief Gets the float value associated with an index
340346
* @param index must be between 0 and length() - 1
347+
* @see JSONArray#getInt(int)
348+
* @see JSONArray#getString(int)
349+
* @see JSONArray#getBoolean(int)
341350
*/
342351
public float getFloat(int index) {
343352
return (float) getDouble(index);
@@ -374,6 +383,9 @@ public double getDouble(int index) {
374383
* @return The truth.
375384
* @throws JSONException If there is no value for the index or if the
376385
* value is not convertible to boolean.
386+
* @see JSONArray#getInt(int)
387+
* @see JSONArray#getFloat(int)
388+
* @see JSONArray#getString(int)
377389
*/
378390
public boolean getBoolean(int index) {
379391
Object object = this.get(index);
@@ -399,6 +411,9 @@ public boolean getBoolean(int index) {
399411
* @return A JSONArray value.
400412
* @throws JSONException If there is no value for the index. or if the
401413
* value is not a JSONArray
414+
* @see JSONArray#getJSONObject(int)
415+
* @see JSONArray#setJSONObject(int, JSONObject)
416+
* @see JSONArray#setJSONArray(int, JSONArray)
402417
*/
403418
public JSONArray getJSONArray(int index) {
404419
Object object = this.get(index);
@@ -418,6 +433,9 @@ public JSONArray getJSONArray(int index) {
418433
* @return A JSONObject value.
419434
* @throws JSONException If there is no value for the index or if the
420435
* value is not a JSONObject
436+
* @see JSONArray#getJSONArray(int)
437+
* @see JSONArray#setJSONObject(int, JSONObject)
438+
* @see JSONArray#setJSONArray(int, JSONArray)
421439
*/
422440
public JSONObject getJSONObject(int index) {
423441
Object object = this.get(index);
@@ -433,6 +451,7 @@ public JSONObject getJSONObject(int index) {
433451
*
434452
* @webref jsonarray:method
435453
* @brief Gets the entire array as an array of Strings
454+
* @see JSONArray#getIntArray()
436455
*/
437456
public String[] getStringArray() {
438457
String[] outgoing = new String[size()];
@@ -448,6 +467,7 @@ public String[] getStringArray() {
448467
*
449468
* @webref jsonarray:method
450469
* @brief Gets the entire array as array of ints
470+
* @see JSONArray#getStringArray()
451471
*/
452472
public int[] getIntArray() {
453473
int[] outgoing = new int[size()];
@@ -682,6 +702,8 @@ public boolean[] getBooleanArray() {
682702
* @brief Appends a value, increasing the array's length by one
683703
* @param value a String value
684704
* @return this.
705+
* @see JSONArray#size()
706+
* @see JSONArray#remove(int)
685707
*/
686708
public JSONArray append(String value) {
687709
this.append((Object)value);
@@ -836,6 +858,9 @@ protected JSONArray append(Object value) {
836858
* @param value the value to assign
837859
* @return this.
838860
* @throws JSONException If the index is negative.
861+
* @see JSONArray#setInt(int, int)
862+
* @see JSONArray#setFloat(int, float)
863+
* @see JSONArray#setBoolean(int, boolean)
839864
*/
840865
public JSONArray setString(int index, String value) {
841866
this.set(index, value);
@@ -854,6 +879,9 @@ public JSONArray setString(int index, String value) {
854879
* @param value the value to assign
855880
* @return this.
856881
* @throws JSONException If the index is negative.
882+
* @see JSONArray#setFloat(int, float)
883+
* @see JSONArray#setString(int, String)
884+
* @see JSONArray#setBoolean(int, boolean)
857885
*/
858886
public JSONArray setInt(int index, int value) {
859887
this.set(index, new Integer(value));
@@ -888,6 +916,9 @@ public JSONArray setLong(int index, long value) {
888916
* @return this.
889917
* @throws RuntimeException If the index is negative or if the value is
890918
* not finite.
919+
* @see JSONArray#setInt(int, int)
920+
* @see JSONArray#setString(int, String)
921+
* @see JSONArray#setBoolean(int, boolean)
891922
*/
892923
public JSONArray setFloat(int index, float value) {
893924
return setDouble(index, value);
@@ -920,6 +951,9 @@ public JSONArray setDouble(int index, double value) {
920951
* @param value the value to assign
921952
* @return this.
922953
* @throws JSONException If the index is negative.
954+
* @see JSONArray#setInt(int, int)
955+
* @see JSONArray#setFloat(int, float)
956+
* @see JSONArray#setString(int, String)
923957
*/
924958
public JSONArray setBoolean(int index, boolean value) {
925959
return set(index, value ? Boolean.TRUE : Boolean.FALSE);
@@ -945,6 +979,9 @@ public JSONArray setBoolean(int index, boolean value) {
945979
* @brief Sets the JSONArray value associated with an index value
946980
* @param index the index value to target
947981
* @param value the value to assign
982+
* @see JSONArray#setJSONObject(int, JSONObject)
983+
* @see JSONArray#getJSONObject(int)
984+
* @see JSONArray#getJSONArray(int)
948985
*/
949986
public JSONArray setJSONArray(int index, JSONArray value) {
950987
set(index, value);
@@ -956,6 +993,9 @@ public JSONArray setJSONArray(int index, JSONArray value) {
956993
* @brief Sets the JSONObject value associated with an index value
957994
* @param index the index value to target
958995
* @param value the value to assign
996+
* @see JSONArray#setJSONArray(int, JSONArray)
997+
* @see JSONArray#getJSONObject(int)
998+
* @see JSONArray#getJSONArray(int)
959999
*/
9601000
public JSONArray setJSONObject(int index, JSONObject value) {
9611001
set(index, value);
@@ -998,6 +1038,8 @@ private JSONArray set(int index, Object value) {
9981038
* @webref jsonarray:method
9991039
* @brief Gets the number of elements in the JSONArray
10001040
* @return The length (or size).
1041+
* @see JSONArray#append(String)
1042+
* @see JSONArray#remove(int)
10011043
*/
10021044
public int size() {
10031045
return myArrayList.size();
@@ -1022,6 +1064,8 @@ protected boolean isNull(int index) {
10221064
* @brief Removes an element
10231065
* @param index the index value of the element to be removed
10241066
* @return The value that was associated with the index, or null if there was no value.
1067+
* @see JSONArray#size()
1068+
* @see JSONArray#append(String)
10251069
*/
10261070
public Object remove(int index) {
10271071
Object o = this.opt(index);

0 commit comments

Comments
 (0)