mirror of
https://github.com/fankes/JSON-java-compat.git
synced 2025-09-06 10:45:23 +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();
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
|
@@ -973,6 +973,14 @@ public class JSONObject {
|
||||
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.
|
||||
*
|
||||
|
Reference in New Issue
Block a user