org.xerial.json
Class JSONArray

java.lang.Object
  extended by org.xerial.json.JSONValueBase
      extended by org.xerial.json.JSONArray
All Implemented Interfaces:
Iterable<JSONValue>, JSONValue

public class JSONArray
extends JSONValueBase
implements Iterable<JSONValue>


Constructor Summary
JSONArray()
           
JSONArray(String jsonStr)
           
 
Method Summary
 void add(JSONValue value)
           
 void add(Object value)
           
 void add(String value)
           
 JSONValue get(int index)
           
 JSONArray getJSONArray()
           
 JSONArray getJSONArray(int i)
           
 JSONBoolean getJSONBoolean(int index)
           
 JSONDouble getJSONDouble(int index)
           
 JSONInteger getJSONInteger(int index)
           
 JSONNumber getJSONNubmer(int index)
           
 JSONNull getJSONNull(int index)
           
 JSONObject getJSONObject(int index)
           
 String getString(int i)
           
 JSONValueType getValueType()
          Gets the JSON value type of this value
 Iterator<JSONValue> iterator()
           
static org.antlr.runtime.tree.CommonTree parse(String jsonStr)
           
 int size()
           
 String toJSONString()
          Produces output of the JSON format of this value
 String toString()
           
 
Methods inherited from class org.xerial.json.JSONValueBase
getJSONBoolean, getJSONNull, getJSONNumber, getJSONObject, getJSONString, join, translateAsJSONValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JSONArray

public JSONArray()

JSONArray

public JSONArray(String jsonStr)
          throws JSONException
Throws:
JSONException
Method Detail

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


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