JSONArray Class

A JSONArray is an ordered sequence of values. Its external text form is a string wrapped in square brackets with commas separating the values.

Constructors

public JSONArray( )
public JSONArray( String source )
protected JSONArray( javaxt.json.JSONTokener x )

Methods

add( boolean value ) returns void
Appends a boolean value. This increases the array's length by one.
add( double value ) returns void
Appends a double value. This increases the array's length by one.
add( int value ) returns void
Appends an int value. This increases the array's length by one.
add( long value ) returns void
Appends an long value. This increases the array's length by one.
add( Object value ) returns void
Appends an object value. This increases the array's length by one.
valueAn object value. The value should be a Boolean, Double, Integer, JSONArray, JSONObject, Long, or String.
equals( Object obj ) returns boolean
Returns true if the given object is a JSONArray and the JSONArray contains the same entries as this array. Order is important.
get( int index ) returns javaxt.utils.Value
Returns the object value associated with an index.
getJSONArray( int index ) returns javaxt.json.JSONArray
Returns the JSONArray associated with an index.
getJSONObject( int index ) returns javaxt.json.JSONObject
Returns the JSONObject associated with an index.
iterator( ) returns java.util.Iterator
length( ) returns int
Returns the number of elements in the JSONArray, included nulls.
remove( int index ) returns Object
Remove entry. Returns the value that was associated with the index, or null if there was no value.
toString( ) returns String
Returns a printable, displayable, transmittable representation of the array. For compactness, no unnecessary whitespace is added. If it is not possible to produce a syntactically correct JSON text then null will be returned instead.
toString( int indentFactor ) returns String
Returns a printable, displayable, transmittable representation of the array.