org.zkoss.json
Class JSONArray

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.AbstractSequentialList<E>
              extended by java.util.LinkedList<java.lang.Object>
                  extended by org.zkoss.json.JSONArray
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<java.lang.Object>, java.util.Collection<java.lang.Object>, java.util.Deque<java.lang.Object>, java.util.List<java.lang.Object>, java.util.Queue<java.lang.Object>, JSONAware

public class JSONArray
extends java.util.LinkedList<java.lang.Object>
implements java.util.List<java.lang.Object>, JSONAware

A JSON array. JSONObject supports java.util.List interface.

Author:
FangYidong
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
JSONArray()
           
 
Method Summary
 java.lang.String toJSONString()
          Encodes this object to a JSON string.
static java.lang.String toJSONString(boolean[] ary)
          Convert a boolean array to JSON text.
static java.lang.String toJSONString(byte[] ary)
          Convert a byte array to JSON text.
static java.lang.String toJSONString(char[] ary)
          Convert a char array to JSON text.
static java.lang.String toJSONString(java.util.Collection collection)
          Convert a list to JSON text.
static java.lang.String toJSONString(double[] ary)
          Convert a double array to JSON text.
static java.lang.String toJSONString(float[] ary)
          Convert a float array to JSON text.
static java.lang.String toJSONString(int[] ary)
          Convert an integer array to JSON text.
static java.lang.String toJSONString(long[] ary)
          Convert a long array to JSON text.
static java.lang.String toJSONString(java.lang.Object[] ary)
          Convert an object array to JSON text.
static java.lang.String toJSONString(short[] ary)
          Convert a short array to JSON text.
 java.lang.String toString()
          Encodes this object to a JSON string.
 
Methods inherited from class java.util.LinkedList
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, toArray, toArray
 
Methods inherited from class java.util.AbstractSequentialList
iterator
 
Methods inherited from class java.util.AbstractList
equals, hashCode, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, removeAll, retainAll
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, size, subList, toArray, toArray
 
Methods inherited from interface java.util.Deque
iterator
 

Constructor Detail

JSONArray

public JSONArray()
Method Detail

toJSONString

public static java.lang.String toJSONString(java.util.Collection collection)
Convert a list to JSON text. The result is a JSON array. If this list is also a JSONAware, JSONAware specific behaviors will be omitted at this top level.

Parameters:
collection -
Returns:
JSON text, or "null" if list is null.
See Also:
JSONValue.toJSONString(Object)

toJSONString

public static java.lang.String toJSONString(java.lang.Object[] ary)
Convert an object array to JSON text.

patched by tomyeh


toJSONString

public static java.lang.String toJSONString(int[] ary)
Convert an integer array to JSON text.

patched by tomyeh


toJSONString

public static java.lang.String toJSONString(long[] ary)
Convert a long array to JSON text.

patched by tomyeh


toJSONString

public static java.lang.String toJSONString(short[] ary)
Convert a short array to JSON text.

patched by tomyeh


toJSONString

public static java.lang.String toJSONString(float[] ary)
Convert a float array to JSON text.

patched by tomyeh


toJSONString

public static java.lang.String toJSONString(double[] ary)
Convert a double array to JSON text.

patched by tomyeh


toJSONString

public static java.lang.String toJSONString(byte[] ary)
Convert a byte array to JSON text.

patched by tomyeh


toJSONString

public static java.lang.String toJSONString(boolean[] ary)
Convert a boolean array to JSON text.

patched by tomyeh


toJSONString

public static java.lang.String toJSONString(char[] ary)
Convert a char array to JSON text.

patched by tomyeh


toJSONString

public java.lang.String toJSONString()
Encodes this object to a JSON string. It is the same as toString().

Specified by:
toJSONString in interface JSONAware
Returns:
JSON text

toString

public java.lang.String toString()
Encodes this object to a JSON string. It is the same as toJSONString().

Overrides:
toString in class java.util.AbstractCollection<java.lang.Object>


Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo