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(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.
|
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.
|
String |
toString()
Create the JSON encoded string representation of this JSONArray instance.
|
public JSONArray()
public JSONArray(JavaScriptObject arr)
arr
- a JavaScript arraypublic JSONValue get(int index)
index
- the index of the array item to retrievenull
if this index is
emptypublic JavaScriptObject getJavaScriptObject()
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()
Copyright © 2018. All rights reserved.