mirror of
https://github.com/processing/processing4.git
synced 2026-02-04 22:29:18 +01:00
Added setString(int, String) and append(String) to JSONArray
String is one of the core datatypes JSONArray supports.
This commit is contained in:
@@ -619,6 +619,18 @@ public class JSONArray {
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* Append an String value. This increases the array's length by one.
|
||||
*
|
||||
* @param value A String value.
|
||||
* @return this.
|
||||
*/
|
||||
public JSONArray append(String value) {
|
||||
this.append((Object)value);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Append an int value. This increases the array's length by one.
|
||||
*
|
||||
@@ -762,6 +774,21 @@ public class JSONArray {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Put or replace a String value. If the index is greater than the length of
|
||||
* the JSONArray, then null elements will be added as necessary to pad
|
||||
* it out.
|
||||
* @param index The subscript.
|
||||
* @param value A String value.
|
||||
* @return this.
|
||||
* @throws JSONException If the index is negative.
|
||||
*/
|
||||
public JSONArray setString(int index, String value) {
|
||||
this.set(index, value);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Put or replace a long value. If the index is greater than the length of
|
||||
* the JSONArray, then null elements will be added as necessary to pad
|
||||
|
||||
Reference in New Issue
Block a user