Constructor and Description |
---|
JSONArray()
Creates an empty JSONArray.
|
JSONArray(JavaScriptObject arr)
Creates a new JSONArray from the supplied JavaScriptObject representing a
JavaScript array.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other)
|
JSONValue |
get(int index)
Returns the value at the specified index position.
|
JavaScriptObject |
getJavaScriptObject()
Returns the underlying JavaScript array that this object wraps.
|
(package private) JavaScriptObject |
getUnwrapper()
Internal.
|
int |
hashCode() |
JSONArray |
isArray()
Returns
this , as this is a JSONArray. |
JSONValue |
set(int index,
JSONValue value)
Sets the specified index to the given value.
|
int |
size()
Returns the number of elements in this array.
|
java.lang.String |
toString()
Create the JSON encoded string representation of this JSONArray instance.
|
public JSONArray()
public JSONArray(JavaScriptObject arr)
arr
- a JavaScript arraypublic boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public JSONValue get(int index)
index
- the index of the array item to retrievenull
if this index is
emptypublic JavaScriptObject getJavaScriptObject()
public int hashCode()
hashCode
in class java.lang.Object
public JSONArray isArray()
this
, as this is a JSONArray.public JSONValue set(int index, JSONValue value)
index
- the index to setvalue
- the value to setnull
if this
index was emptypublic int size()
public java.lang.String toString()
JavaScriptObject getUnwrapper()
JSONValue
getUnwrapper
in class JSONValue