public class JSONArray extends ArrayList<Object>
modCount
Constructor and Description |
---|
JSONArray()
Construct a new, empty array.
|
Modifier and Type | Method and Description |
---|---|
JSONArray |
getArray(int index)
Obtain an array-valued element value.
|
boolean |
getBoolean(int index)
Obtain the boolean value of an element.
|
double |
getDouble(int index)
Obtain the double value of an element.
|
int |
getInt(int index)
Obtain the integer value of an element.
|
long |
getLong(int index)
Obtain the long value of an element.
|
JSONObject |
getObject(int index)
Obtain the JSON object value of an element.
|
String |
getString(int index)
Obtain the string value of an element.
|
JSONLiteralArray |
literal(EncodeControl control)
Convert this JSONArray into a JSONLiteralArray.
|
String |
sendableString()
Obtain a string representation of this array suitable for output to a
connection.
|
String |
toString()
Obtain a printable string representation of this JSON array.
|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeRange, retainAll, set, size, subList, toArray, toArray, trimToSize
equals, hashCode
containsAll
finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode
public JSONLiteralArray literal(EncodeControl control)
control
- Encode control determining what flavor of encoding
is being done.public JSONArray getArray(int index) throws JSONDecodingException
index
- The index of the array value sought.JSONDecodingException
- if the value is not an array.public boolean getBoolean(int index) throws JSONDecodingException
index
- The index of the boolean value sought.JSONDecodingException
- if the value is not a boolean.public double getDouble(int index) throws JSONDecodingException
index
- The index of the double value sought.JSONDecodingException
- if the value is not a number.public int getInt(int index) throws JSONDecodingException
index
- The index of the integer value sought.JSONDecodingException
- if the value is not a number.public long getLong(int index) throws JSONDecodingException
index
- The index of the long value sought.JSONDecodingException
- if the value is not a number.public JSONObject getObject(int index) throws JSONDecodingException
index
- The index of the object value sought.JSONDecodingException
- if the value is not a JSON object.public String getString(int index) throws JSONDecodingException
index
- The index of the string value sought.JSONDecodingException
- if the value is not a string.public String sendableString()
public String toString()
toString
in class AbstractCollection<Object>
Copyright © 2017. All rights reserved.