@Deprecated public class UnmodifiableJSONArray extends java.lang.Object implements JSONArray
| Modifier and Type | Method and Description |
|---|---|
<A extends JSONArray,O extends JSONObject> |
clone(JSONBuilder<A,O> builder)
Deprecated.
|
boolean |
equals(java.lang.Object obj)
Deprecated.
|
boolean |
equalsList(java.util.List<java.lang.Object> list)
Deprecated.
|
java.lang.Object |
get(int index)
Deprecated.
Get the object value associated with an index.
|
boolean |
getBoolean(int index)
Deprecated.
Get the boolean value associated with an index.
|
double |
getDouble(int index)
Deprecated.
Get the double value associated with an index.
|
static UnmodifiableJSONArray |
getInstance(JSONArray jArr)
Deprecated.
|
int |
getInt(int index)
Deprecated.
Get the int value associated with an index.
|
JSONArray |
getJSONArray(int index)
Deprecated.
Get the JSONArray associated with an index.
|
JSONObject |
getJSONObject(int index)
Deprecated.
Get the JSONObject associated with an index.
|
long |
getLong(int index)
Deprecated.
Get the long value associated with an index.
|
java.lang.String |
getString(int index)
Deprecated.
Get the string associated with an index.
|
int |
hashCode()
Deprecated.
|
int |
indexOf(java.lang.Object value)
Deprecated.
|
boolean |
isNull(int index)
Deprecated.
Determine if the value is null.
|
java.util.Iterator<java.lang.Object> |
iterator()
Deprecated.
|
int |
length()
Deprecated.
Get the number of elements in the JSONArray, included nulls.
|
java.lang.Object |
opt(int index)
Deprecated.
Get the optional object value associated with an index.
|
boolean |
optBoolean(int index)
Deprecated.
Get the optional boolean value associated with an index.
|
boolean |
optBoolean(int index,
boolean defaultValue)
Deprecated.
Get the optional boolean value associated with an index.
|
double |
optDouble(int index)
Deprecated.
Get the optional double value associated with an index.
|
double |
optDouble(int index,
double defaultValue)
Deprecated.
Get the optional double value associated with an index.
|
int |
optInt(int index)
Deprecated.
Get the optional int value associated with an index.
|
int |
optInt(int index,
int defaultValue)
Deprecated.
Get the optional int value associated with an index.
|
JSONArray |
optJSONArray(int index)
Deprecated.
Get the optional JSONArray associated with an index.
|
JSONObject |
optJSONObject(int index)
Deprecated.
Get the optional JSONObject associated with an index.
|
long |
optLong(int index)
Deprecated.
Get the optional long value associated with an index.
|
long |
optLong(int index,
long defaultValue)
Deprecated.
Get the optional long value associated with an index.
|
java.lang.String |
optString(int index)
Deprecated.
Get the optional string value associated with an index.
|
java.lang.String |
optString(int index,
java.lang.String defaultValue)
Deprecated.
Get the optional string associated with an index.
|
JSONArray |
put(boolean value)
Deprecated.
Append a boolean value.
|
JSONArray |
put(double value)
Deprecated.
Append a double value.
|
JSONArray |
put(int value)
Deprecated.
Append an int value.
|
JSONArray |
put(int index,
boolean value)
Deprecated.
Put or replace a boolean value in the JSONArray.
|
JSONArray |
put(int index,
double value)
Deprecated.
Put or replace a double value.
|
JSONArray |
put(int index,
int value)
Deprecated.
Put or replace an int value.
|
JSONArray |
put(int index,
long value)
Deprecated.
Put or replace a long value.
|
JSONArray |
put(int index,
java.lang.Object value)
Deprecated.
Put or replace an object value in the JSONArray.
|
JSONArray |
put(long value)
Deprecated.
Append an long value.
|
JSONArray |
put(java.lang.Object value)
Deprecated.
Append an object value.
|
java.lang.Object |
remove(int index)
Deprecated.
Remove an index and close the hole.
|
boolean |
remove(java.lang.Object obj)
Deprecated.
Remove the first instance of an Object from the array.
|
java.lang.String |
toString()
Deprecated.
Make a JSON text of this JSONObject.
|
java.lang.String |
toString(int indentFactor)
Deprecated.
Make a prettyprinted JSON text of this JSONObject.
|
java.lang.String |
toString(int indentFactor,
int indent)
Deprecated.
Make a prettyprinted JSON text of this JSONObject.
|
java.lang.Appendable |
write(java.lang.Appendable writer)
Deprecated.
Write the contents of the JSONComponent as JSON text to a writer.
|
public static UnmodifiableJSONArray getInstance(JSONArray jArr)
public java.lang.Object get(int index)
JSONArraypublic boolean getBoolean(int index)
throws JSONException
JSONArraygetBoolean in interface JSONArrayindex - The index must be between 0 and length() - 1.JSONException - If there is no value for the index or if the value is not convertible to boolean.public double getDouble(int index)
throws JSONException
JSONArraygetDouble in interface JSONArrayindex - The index must be between 0 and length() - 1.JSONException - If the key is not found or if the value cannot be converted to a number.public int getInt(int index)
throws JSONException
JSONArraygetInt in interface JSONArrayindex - The index must be between 0 and length() - 1.JSONException - If the key is not found or if the value is not a number.public JSONArray getJSONArray(int index) throws JSONException
JSONArraygetJSONArray in interface JSONArrayindex - The index must be between 0 and length() - 1.JSONException - If there is no value for the index. or if the value is not a JSONArraypublic JSONObject getJSONObject(int index) throws JSONException
JSONArraygetJSONObject in interface JSONArrayindex - subscriptJSONException - If there is no value for the index or if the value is not a JSONObjectpublic long getLong(int index)
throws JSONException
JSONArraygetLong in interface JSONArrayindex - The index must be between 0 and length() - 1.JSONException - If the key is not found or if the value cannot be converted to a number.public java.lang.String getString(int index)
throws JSONException
JSONArraygetString in interface JSONArrayindex - The index must be between 0 and length() - 1.JSONException - If there is no value for the index.public boolean isNull(int index)
JSONArraypublic int length()
JSONArraypublic java.lang.Object opt(int index)
JSONArraypublic boolean optBoolean(int index)
JSONArrayoptBoolean in interface JSONArrayindex - The index must be between 0 and length() - 1.public boolean optBoolean(int index,
boolean defaultValue)
JSONArrayoptBoolean in interface JSONArrayindex - The index must be between 0 and length() - 1.defaultValue - A boolean default.public double optDouble(int index)
JSONArraypublic double optDouble(int index,
double defaultValue)
JSONArraypublic int optInt(int index)
JSONArraypublic int optInt(int index,
int defaultValue)
JSONArraypublic JSONArray optJSONArray(int index)
JSONArrayoptJSONArray in interface JSONArrayindex - subscriptpublic JSONObject optJSONObject(int index)
JSONArrayoptJSONObject in interface JSONArrayindex - The index must be between 0 and length() - 1.public long optLong(int index)
JSONArraypublic long optLong(int index,
long defaultValue)
JSONArraypublic java.lang.String optString(int index)
JSONArraypublic java.lang.String optString(int index,
java.lang.String defaultValue)
JSONArraypublic JSONArray put(boolean value)
JSONArraypublic JSONArray put(double value) throws JSONException
JSONArrayput in interface JSONArrayvalue - A double value.JSONException - if the value is not finite.public JSONArray put(int value)
JSONArraypublic JSONArray put(long value)
JSONArraypublic JSONArray put(java.lang.Object value)
JSONArraypublic JSONArray put(int index, boolean value) throws JSONException
JSONArrayput in interface JSONArrayindex - The subscript.value - A boolean value.JSONException - If the index is negative.public JSONArray put(int index, double value) throws JSONException
JSONArrayput in interface JSONArrayindex - The subscript.value - A double value.JSONException - If the index is negative or if the value is not finite.public JSONArray put(int index, int value) throws JSONException
JSONArrayput in interface JSONArrayindex - The subscript.value - An int value.JSONException - If the index is negative.public JSONArray put(int index, long value) throws JSONException
JSONArrayput in interface JSONArrayindex - The subscript.value - A long value.JSONException - If the index is negative.public JSONArray put(int index, java.lang.Object value) throws JSONException
JSONArrayput in interface JSONArrayindex - The subscript.value - The value to put into the array. The value should be a Boolean, Double, Integer,
JSONArray, JSONObject, Long, or String, or the JSONObject.NULL object.JSONException - If the index is negative or if the the value is an invalid number.public java.lang.Object remove(int index)
JSONArraypublic boolean remove(java.lang.Object obj)
throws java.lang.UnsupportedOperationException
JSONArraypublic java.lang.String toString(int indentFactor)
JSONComponentWarning: This method assumes that the data structure is acyclical.
toString in interface JSONComponentindentFactor - The number of spaces to add to each level of indentation.{ (left brace) and ending with
} (right brace).public java.lang.String toString()
JSONComponentWarning: This method assumes that the data structure is acyclical.
toString in interface JSONComponenttoString in class java.lang.Object{ (left brace) and ending with
} (right brace).public java.lang.Appendable write(java.lang.Appendable writer)
throws java.io.IOException
JSONComponentWarning: This method assumes that the data structure is acyclical.
write in interface JSONComponentjava.io.IOExceptionpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equalsList(java.util.List<java.lang.Object> list)
equalsList in interface JSONArraypublic java.util.Iterator<java.lang.Object> iterator()
public int indexOf(java.lang.Object value)
public java.lang.String toString(int indentFactor,
int indent)
JSONComponentWarning: This method assumes that the data structure is acyclical.
toString in interface JSONComponentindentFactor - The number of spaces to add to each level of indentation.indent - The indentation of the top level.{ (left brace) and ending with }
(right brace).public <A extends JSONArray,O extends JSONObject> A clone(JSONBuilder<A,O> builder) throws JSONException
clone in interface JSONArrayJSONException