mirror of
https://github.com/fankes/JSON-java-compat.git
synced 2025-09-07 03:06:03 +08:00
Added clear() methods to JSONObject and JSONArray
This commit is contained in:
@@ -567,6 +567,14 @@ public class JSONArray implements Iterable<Object> {
|
|||||||
return this.myArrayList.size();
|
return this.myArrayList.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes all of the elements from this JSONArray.
|
||||||
|
* The JSONArray will be empty after this call returns.
|
||||||
|
*/
|
||||||
|
public void clear() {
|
||||||
|
return this.map.clear();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the optional object value associated with an index.
|
* Get the optional object value associated with an index.
|
||||||
*
|
*
|
||||||
|
@@ -973,6 +973,14 @@ public class JSONObject {
|
|||||||
return this.map.size();
|
return this.map.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Removes all of the elements from this JSONObject.
|
||||||
|
* The JSONObject will be empty after this call returns.
|
||||||
|
*/
|
||||||
|
public void clear() {
|
||||||
|
return this.map.clear();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if JSONObject is empty.
|
* Check if JSONObject is empty.
|
||||||
*
|
*
|
||||||
|
Reference in New Issue
Block a user