Java org.json JSONArray fields, constructors, methods, implement or subclass

Example usage for Java org.json JSONArray fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for org.json JSONArray.

The text is from its open source code.

Subclass

org.json.JSONArray has subclasses.
Click this link to see all its subclasses.

Constructor

JSONArray(JSONTokener x)
Construct a JSONArray from a JSONTokener.
JSONArray(String source)
Construct a JSONArray from a source JSON text.
JSONArray(Collection collection)
Construct a JSONArray from a Collection.
JSONArray(Object array)
Construct a JSONArray from an array
JSONArray()
Construct an empty JSONArray.

Method

booleanequals(Object obj)
Indicates whether some other object is "equal to" this one.
Objectget(int index)
Get the object value associated with an index.
booleangetBoolean(int index)
Get the boolean value associated with an index.
ClassgetClass()
Returns the runtime class of this Object .
doublegetDouble(int index)
Get the double value associated with an index.
intgetInt(int index)
Get the int value associated with an index.
JSONArraygetJSONArray(int index)
Get the JSONArray associated with an index.
JSONObjectgetJSONObject(int index)
Get the JSONObject associated with an index.
longgetLong(int index)
Get the long value associated with an index.
StringgetString(int index)
Get the string associated with an index.
booleanisNull(int index)
Determine if the value is null.
Stringjoin(String separator)
Make a string from the contents of this JSONArray.
intlength()
Get the number of elements in the JSONArray, included nulls.
Objectopt(int index)
Get the optional object value associated with an index.
booleanoptBoolean(int index)
Get the optional boolean value associated with an index.
doubleoptDouble(int index, double defaultValue)
Get the optional double value associated with an index.
intoptInt(int index)
Get the optional int value associated with an index.
intoptInt(int index, int defaultValue)
Get the optional int value associated with an index.
JSONArrayoptJSONArray(int index)
Get the optional JSONArray associated with an index.
JSONObjectoptJSONObject(int index)
Get the optional JSONObject associated with an index.
longoptLong(int index)
Get the optional long value associated with an index.
longoptLong(int index, long defaultValue)
Get the optional long value associated with an index.
StringoptString(int index)
Get the optional string value associated with an index.
StringoptString(int index, String defaultValue)
Get the optional string associated with an index.
JSONArrayput(boolean value)
Append a boolean value.
JSONArrayput(Collection value)
Put a value in the JSONArray, where the value will be a JSONArray which is produced from a Collection.
JSONArrayput(double value)
Append a double value.
JSONArrayput(int value)
Append an int value.
JSONArrayput(long value)
Append an long value.
JSONArrayput(Map value)
Put a value in the JSONArray, where the value will be a JSONObject which is produced from a Map.
JSONArrayput(Object value)
Append an object value.
JSONArrayput(int index, boolean value)
Put or replace a boolean value in the JSONArray.
JSONArrayput(int index, Collection value)
Put a value in the JSONArray, where the value will be a JSONArray which is produced from a Collection.
JSONArrayput(int index, double value)
Put or replace a double value.
JSONArrayput(int index, int value)
Put or replace an int value.
JSONArrayput(int index, long value)
Put or replace a long value.
JSONArrayput(int index, Map value)
Put a value in the JSONArray, where the value will be a JSONObject which is produced from a Map.
JSONArrayput(int index, Object value)
Put or replace an object value in the JSONArray.
JSONObjecttoJSONObject(JSONArray names)
Produce a JSONObject by combining a JSONArray of names with the values of this JSONArray.
StringtoString()
Make a JSON text of this JSONArray.
StringtoString(int indentFactor)
Make a prettyprinted JSON text of this JSONArray.
Writerwrite(Writer writer)
Write the contents of the JSONArray as JSON text to a writer.