mirror of
https://github.com/processing/processing4.git
synced 2026-02-12 10:00:42 +01:00
Added reference for JSONArray, JSONObject, loadJSONArray(), loadJSONObject(), saveJSONArray(), saveJSONObject()
This commit is contained in:
@@ -92,6 +92,11 @@ import processing.core.PApplet;
|
||||
* @author JSON.org
|
||||
* @version 2012-11-13
|
||||
* @webref data:composite
|
||||
* @see JSONObject
|
||||
* @see PApplet#loadJSONObject(String)
|
||||
* @see PApplet#loadJSONArray(String)
|
||||
* @see PApplet#saveJSONObject(JSONObject, String)
|
||||
* @see PApplet#saveJSONArray(JSONArray, String)
|
||||
*/
|
||||
public class JSONArray {
|
||||
|
||||
@@ -103,12 +108,16 @@ public class JSONArray {
|
||||
|
||||
/**
|
||||
* Construct an empty JSONArray.
|
||||
* @nowebref
|
||||
*/
|
||||
public JSONArray() {
|
||||
this.myArrayList = new ArrayList<Object>();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @nowebref
|
||||
*/
|
||||
public JSONArray(Reader reader) {
|
||||
this(new JSONTokener(reader));
|
||||
}
|
||||
@@ -152,6 +161,9 @@ public class JSONArray {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @nowebref
|
||||
*/
|
||||
public JSONArray(IntList list) {
|
||||
myArrayList = new ArrayList<Object>();
|
||||
for (int item : list.values()) {
|
||||
@@ -160,6 +172,9 @@ public class JSONArray {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @nowebref
|
||||
*/
|
||||
public JSONArray(FloatList list) {
|
||||
myArrayList = new ArrayList<Object>();
|
||||
for (float item : list.values()) {
|
||||
@@ -168,6 +183,9 @@ public class JSONArray {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @nowebref
|
||||
*/
|
||||
public JSONArray(StringList list) {
|
||||
myArrayList = new ArrayList<Object>();
|
||||
for (String item : list.values()) {
|
||||
@@ -658,10 +676,10 @@ public class JSONArray {
|
||||
/**
|
||||
* Append an String value. This increases the array's length by one.
|
||||
*
|
||||
* @webref jsonarray:method
|
||||
* @brief Appends a String value, increasing the array's length by one
|
||||
* @param value A String value.
|
||||
* @return this.
|
||||
* @webref jsonarray:method
|
||||
* @brief Append an String value. This increases the array's length by one.
|
||||
*/
|
||||
public JSONArray append(String value) {
|
||||
this.append((Object)value);
|
||||
@@ -959,9 +977,9 @@ public class JSONArray {
|
||||
/**
|
||||
* Get the number of elements in the JSONArray, included nulls.
|
||||
*
|
||||
* @return The length (or size).
|
||||
* @webref jsonarray:method
|
||||
* @brief Get the number of elements in the JSONArray, included nulls
|
||||
* @brief Gets the number of elements in the JSONArray, included nulls
|
||||
* @return The length (or size).
|
||||
*/
|
||||
public int size() {
|
||||
return myArrayList.size();
|
||||
@@ -982,11 +1000,10 @@ public class JSONArray {
|
||||
/**
|
||||
* Remove an index and close the hole.
|
||||
*
|
||||
* @param index The index of the element to be removed.
|
||||
* @return The value that was associated with the index,
|
||||
* or null if there was no value.
|
||||
* @webref jsonarray:method
|
||||
* @brief Remove an index and close the hole
|
||||
* @param index The index of the element to be removed.
|
||||
* @return The value that was associated with the index, or null if there was no value.
|
||||
*/
|
||||
public Object remove(int index) {
|
||||
Object o = this.opt(index);
|
||||
|
||||
@@ -104,6 +104,11 @@ import processing.core.PApplet;
|
||||
* @author JSON.org
|
||||
* @version 2012-12-01
|
||||
* @webref data:composite
|
||||
* @see JSONArray
|
||||
* @see PApplet#loadJSONObject(String)
|
||||
* @see PApplet#loadJSONArray(String)
|
||||
* @see PApplet#saveJSONObject(JSONObject, String)
|
||||
* @see PApplet#saveJSONArray(JSONArray, String)
|
||||
*/
|
||||
public class JSONObject {
|
||||
/**
|
||||
@@ -189,6 +194,7 @@ public class JSONObject {
|
||||
|
||||
/**
|
||||
* Construct an empty JSONObject.
|
||||
* @nowebref
|
||||
*/
|
||||
public JSONObject() {
|
||||
this.map = new HashMap<String, Object>();
|
||||
@@ -215,6 +221,9 @@ public class JSONObject {
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* @nowebref
|
||||
*/
|
||||
public JSONObject(Reader reader) {
|
||||
this(new JSONTokener(reader));
|
||||
}
|
||||
@@ -299,6 +308,9 @@ public class JSONObject {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @nowebref
|
||||
*/
|
||||
public JSONObject(IntDict dict) {
|
||||
map = new HashMap<String, Object>();
|
||||
for (int i = 0; i < dict.size(); i++) {
|
||||
@@ -307,6 +319,9 @@ public class JSONObject {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @nowebref
|
||||
*/
|
||||
public JSONObject(FloatDict dict) {
|
||||
map = new HashMap<String, Object>();
|
||||
for (int i = 0; i < dict.size(); i++) {
|
||||
@@ -315,6 +330,9 @@ public class JSONObject {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @nowebref
|
||||
*/
|
||||
public JSONObject(StringDict dict) {
|
||||
map = new HashMap<String, Object>();
|
||||
for (int i = 0; i < dict.size(); i++) {
|
||||
|
||||
Reference in New Issue
Block a user