net.tomp2p.examples.json.simple
Class JSONArray
java.lang.Object
  
java.util.AbstractCollection<E>
      
java.util.AbstractList<E>
          
java.util.ArrayList
              
net.tomp2p.examples.json.simple.JSONArray
- All Implemented Interfaces: 
 - Serializable, Cloneable, Iterable, Collection, List, RandomAccess, JSONAware, JSONStreamAware
 
public class JSONArray
- extends ArrayList
- implements List, JSONAware, JSONStreamAware
  
A JSON array. JSONObject supports java.util.List interface.
- Author:
 
  - FangYidong
 
- See Also:
 - Serialized Form
 
 
 
 
 
| Methods inherited from class java.util.ArrayList | 
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeRange, retainAll, set, size, subList, toArray, toArray, trimToSize | 
 
 
 
 
| 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 | 
 
JSONArray
public JSONArray()
writeJSONString
public static void writeJSONString(List list,
                                   Writer out)
                            throws IOException
- Encode a list into JSON text and write it to out. If this list is also a JSONStreamAware or a JSONAware,
 JSONStreamAware and JSONAware specific behaviours will be ignored at this top level.
 
- Parameters:
 list - out - 
- Throws:
 IOException- See Also:
 org.json.simple.JSONValue#writeJSONString(Object, Writer)
 
 
writeJSONString
public void writeJSONString(Writer out)
                     throws IOException
- Description copied from interface: 
JSONStreamAware 
- write JSON string to out.
- Specified by:
 writeJSONString in interface JSONStreamAware
 
- Throws:
 IOException
 
 
toJSONString
public static String toJSONString(List list)
- Convert a list to JSON text. The result is a JSON array. If this list is also a JSONAware, JSONAware specific
 behaviours will be omitted at this top level.
 
- Parameters:
 list - 
- Returns:
 - JSON text, or "null" if list is null.
 - See Also:
 org.json.simple.JSONValue#toJSONString(Object)
 
 
toJSONString
public String toJSONString()
- Specified by:
 toJSONString in interface JSONAware
 
- Returns:
 - JSON text
 
 
toString
public String toString()
- Overrides:
 toString in class AbstractCollection
 
 
Copyright © 2012. All Rights Reserved.