|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<Object>
org.elkoserver.json.JSONArray
public class JSONArray
A parsed JSON array. This class represents a JSON array that has been received or is being constructed.
| Field Summary |
|---|
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
JSONArray()
Construct a new, empty array. |
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.util.ArrayList |
|---|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize |
| Methods inherited from class java.util.AbstractList |
|---|
equals, hashCode, iterator, listIterator, listIterator, subList |
| Methods inherited from class java.util.AbstractCollection |
|---|
containsAll, removeAll, retainAll |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.List |
|---|
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList |
| Constructor Detail |
|---|
public JSONArray()
| Method Detail |
|---|
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>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||