java.lang.Object | ||
↳ | org.json.JSONObject | |
↳ | edu.stanford.junction.addon.JSONObjWrapper |
A wrapper for JSONObjects that provides hashCode and equals methods based on the underlying JSONObject's 'id' property. Useful when you want a HashSet/HashMap of JSONObjects, and each object has a unique 'id'. Also provides deep copy and compression routines.
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.json.JSONObject
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Get the value object associated with a key.
| |||||||||||
Determine if the JSONObject contains a specific key.
| |||||||||||
Get an enumeration of the keys of the JSONObject.
| |||||||||||
Get the number of keys stored in the JSONObject.
| |||||||||||
Get an optional value associated with a key.
| |||||||||||
Put a key/value pair in the JSONObject.
| |||||||||||
Put a key/boolean pair in the JSONObject.
| |||||||||||
Put a key/int pair in the JSONObject.
| |||||||||||
Put a key/long pair in the JSONObject.
| |||||||||||
Put a key/double pair in the JSONObject.
| |||||||||||
Remove a name and its value, if present.
| |||||||||||
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.json.JSONObject
| |||||||||||
From class
java.lang.Object
|
Get the value object associated with a key.
key | A key string. |
---|
JSONException | if the key is not found. |
---|
Determine if the JSONObject contains a specific key.
key | A key string. |
---|
Get an enumeration of the keys of the JSONObject.
Get the number of keys stored in the JSONObject.
Get an optional value associated with a key.
key | A key string. |
---|
Put a key/value pair in the JSONObject. If the value is null, then the key will be removed from the JSONObject if it is present.
key | A key string. |
---|---|
value | An object which is the value. It should be of one of these types: Boolean, Double, Integer, JSONArray, JSONObject, Long, String, or the JSONObject.NULL object. |
JSONException | If the value is non-finite number or if the key is null. |
---|
Put a key/boolean pair in the JSONObject.
key | A key string. |
---|---|
value | A boolean which is the value. |
JSONException | If the key is null. |
---|
Put a key/int pair in the JSONObject.
key | A key string. |
---|---|
value | An int which is the value. |
JSONException | If the key is null. |
---|
Put a key/long pair in the JSONObject.
key | A key string. |
---|---|
value | A long which is the value. |
JSONException | If the key is null. |
---|
Put a key/double pair in the JSONObject.
key | A key string. |
---|---|
value | A double which is the value. |
JSONException | If the key is null or if the number is invalid. |
---|
Remove a name and its value, if present.
key | The name to be removed. |
---|