mirror of
https://github.com/stleary/JSON-java.git
synced 2025-08-05 20:35:37 -04:00
Added clear() methods to JSONObject and JSONArray
This commit is contained in:
parent
a57eff26d5
commit
57ad94ef5e
@ -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.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user