org.xerial.json
Class JSONArray
java.lang.Object
org.xerial.json.JSONValueBase
org.xerial.json.JSONArray
- All Implemented Interfaces:
- Iterable<JSONValue>, JSONValue
public class JSONArray
- extends JSONValueBase
- implements Iterable<JSONValue>
JSONArray
public JSONArray()
JSONArray
public JSONArray(String jsonStr)
throws JSONException
- Throws:
JSONException
parse
public static org.antlr.runtime.tree.CommonTree parse(String jsonStr)
throws JSONException
- Throws:
JSONException
add
public void add(JSONValue value)
add
public void add(Object value)
throws JSONException
- Throws:
JSONException
add
public void add(String value)
size
public int size()
get
public JSONValue get(int index)
getJSONNubmer
public JSONNumber getJSONNubmer(int index)
getJSONInteger
public JSONInteger getJSONInteger(int index)
getJSONDouble
public JSONDouble getJSONDouble(int index)
getJSONObject
public JSONObject getJSONObject(int index)
getJSONArray
public JSONArray getJSONArray()
- Specified by:
getJSONArray in interface JSONValue- Overrides:
getJSONArray in class JSONValueBase
- Returns:
- JSONArray representation of this object if this instance is a JSONArray, otherwise null
getJSONArray
public JSONArray getJSONArray(int i)
getJSONBoolean
public JSONBoolean getJSONBoolean(int index)
getJSONNull
public JSONNull getJSONNull(int index)
iterator
public Iterator<JSONValue> iterator()
- Specified by:
iterator in interface Iterable<JSONValue>
toString
public String toString()
- Overrides:
toString in class Object
toJSONString
public String toJSONString()
- Description copied from interface:
JSONValue
- Produces output of the JSON format of this value
- Specified by:
toJSONString in interface JSONValue- Overrides:
toJSONString in class JSONValueBase
- Returns:
- the JSON output
getString
public String getString(int i)
getValueType
public JSONValueType getValueType()
- Description copied from interface:
JSONValue
- Gets the JSON value type of this value
- Specified by:
getValueType in interface JSONValue
- Returns:
- the
JSONValueType

This work is licensed under a Creative Commons Attribution-ShareAlike 2.1 Japan License.