|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.javajson.JsonArray
public class JsonArray
Constructor Summary | |
---|---|
JsonArray()
|
Method Summary | |
---|---|
JsonArray |
add(boolean value)
|
JsonArray |
add(double value)
|
JsonArray |
add(float value)
|
JsonArray |
add(int value)
|
JsonArray |
add(JsonArray value)
|
JsonArray |
add(JsonObject value)
|
JsonArray |
add(long value)
|
JsonArray |
add(Object value)
|
JsonArray |
add(String value)
|
boolean |
getBoolean(int index)
|
double |
getDouble(int index)
|
float |
getFloat(int index)
|
int |
getInt(int index)
|
JsonArray |
getJsonArray(int index)
|
JsonObject |
getJsonObject(int index)
|
long |
getLong(int index)
|
String |
getString(int index)
|
boolean |
isBoolean(int index)
Checks if the item at an index is a boolean. |
boolean |
isDouble(int index)
Checks if the item at an index is a double. |
boolean |
isFloat(int index)
Checks if the item at an index is a float. |
boolean |
isInt(int index)
Checks if the item at an index is a int. |
boolean |
isJsonArray(int index)
Checks if the item at an index is an array. |
boolean |
isJsonObject(int index)
Checks if the item at an index is an object. |
boolean |
isLong(int index)
Checks if the item at an index is a long. |
boolean |
isSimilar(JsonArray obj)
Checks if the structure of this json array is similar to that of another array. |
boolean |
isString(int index)
Checks if the item at an index is an string. |
Iterator<JsonValue> |
iterator()
|
static JsonArray |
parse(InputStream is)
Parses a string to a json object. |
static JsonArray |
parse(Reader reader)
Parses a string to a json object. |
static JsonArray |
parse(String input)
Parses a string to a json object. |
int |
size()
|
String |
toString()
|
String |
toString(int spacing)
Returns a nicely formatted string |
protected String |
toString(int spacing,
int margin)
Called by toString(int) to keep track of the spacing |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JsonArray()
Method Detail |
---|
public static JsonArray parse(String input) throws JsonException
JsonException
public static JsonArray parse(Reader reader) throws JsonException
JsonException
public static JsonArray parse(InputStream is) throws JsonException
JsonException
public JsonArray add(boolean value)
public JsonArray add(double value)
public JsonArray add(float value)
public JsonArray add(int value)
public JsonArray add(long value)
public JsonArray add(JsonArray value)
public JsonArray add(JsonObject value)
public JsonArray add(String value)
public JsonArray add(Object value)
public boolean getBoolean(int index)
index
-
ClassCastException
- if the value cannot be converted to a boolean
IndexOutOfBoundsException
- if its out of boundspublic double getDouble(int index)
ClassCastException
- if the value cannot be converted to a double
IndexOutOfBoundsException
- if its out of boundspublic float getFloat(int index)
ClassCastException
- if the value cannot be converted to a double
IndexOutOfBoundsException
- if its out of boundspublic int getInt(int index)
ClassCastException
- if the value cannot be converted to a double
IndexOutOfBoundsException
- if its out of boundspublic JsonArray getJsonArray(int index)
ClassCastException
- if the value cannot be converted to a double
IndexOutOfBoundsException
- if its out of boundspublic JsonObject getJsonObject(int index)
ClassCastException
- if the value cannot be converted to a double
IndexOutOfBoundsException
- if its out of boundspublic long getLong(int index)
ClassCastException
- if the value cannot be converted to a double
IndexOutOfBoundsException
- if its out of boundspublic String getString(int index)
IndexOutOfBoundsException
- if its out of boundspublic boolean isBoolean(int index)
JsonValue.isBoolean()
for more information
index
- The index of the array to check
IndexOutOfBoundsException
public boolean isDouble(int index)
JsonValue.isLong()
for more information
index
- The index of the array to check
IndexOutOfBoundsException
public boolean isFloat(int index)
JsonValue.isLong()
for more information
index
- The index of the array to check
IndexOutOfBoundsException
public boolean isInt(int index)
JsonValue.isLong()
for more information
index
- The index of the array to check
IndexOutOfBoundsException
public boolean isJsonArray(int index)
JsonValue.isJsonArray()
for more information
index
- The index of the array to check
IndexOutOfBoundsException
public boolean isJsonObject(int index)
JsonValue.isJsonObject()
for more information
index
- The index of the array to check
IndexOutOfBoundsException
public boolean isLong(int index)
JsonValue.isLong()
for more information
index
- The index of the array to check
IndexOutOfBoundsException
public boolean isString(int index)
JsonValue.isString()
for more information
index
- The index of the array to check
IndexOutOfBoundsException
public boolean isSimilar(JsonArray obj)
obj
-
public Iterator<JsonValue> iterator()
iterator
in interface Iterable<JsonValue>
public int size()
public String toString()
toString
in class Object
public String toString(int spacing)
spacing
-
protected String toString(int spacing, int margin)
spacing
- margin
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |