Methods Summary |
---|
public void | add(JSONValue value)Add an item to the end of the list
values.add(value);
|
public void | add(int index, JSONValue element)Add an item at the specified position within the array.
values.add(index, element);
|
public JSONValue | get(int index)throws java array index out of bounds
return (JSONValue) values.get(index);
|
public com.oreilly.ajax.client.JSONArray | isArray()
return this;
|
public JSONValue | set(int index, JSONValue element)Replaces the JSONValue object at the specified instance
return (JSONValue) values.set(index, element);
|
public int | size()Returns the number of elements in this array.
return values.size();
|
public java.lang.String | toString()Create the JSON encoded string representation of this JSONArray instance.
StringBuffer sb = new StringBuffer();
Iterator iter = values.iterator();
sb.append("[");
while (iter.hasNext()) {
JSONValue value = (JSONValue) iter.next();
sb.append(value.toString());
if (iter.hasNext()) {
sb.append(",");
}
}
sb.append("]");
return sb.toString();
|