Package org.json.simple
Class JSONArray
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList
-
- org.json.simple.JSONArray
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Iterable,java.util.Collection,java.util.List,java.util.RandomAccess,JSONAware,JSONStreamAware
@Deprecated public class JSONArray extends java.util.ArrayList implements JSONAware, JSONStreamAware
Deprecated.since 2.0.0, replaced byJsonArrayA JSON array. JSONObject supports java.util.List interface.- Author:
- FangYidong<fangyidong@yahoo.com.cn>
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.StringtoJSONString()Deprecated.static java.lang.StringtoJSONString(boolean[] array)Deprecated.description omitted.static java.lang.StringtoJSONString(byte[] array)Deprecated.description omitted.static java.lang.StringtoJSONString(char[] array)Deprecated.description omitted.static java.lang.StringtoJSONString(double[] array)Deprecated.description omitted.static java.lang.StringtoJSONString(float[] array)Deprecated.description omitted.static java.lang.StringtoJSONString(int[] array)Deprecated.description omitted.static java.lang.StringtoJSONString(long[] array)Deprecated.description omitted.static java.lang.StringtoJSONString(short[] array)Deprecated.description omitted.static java.lang.StringtoJSONString(java.lang.Object[] array)Deprecated.description omitted.static java.lang.StringtoJSONString(java.util.Collection collection)Deprecated.Convert a list to JSON text.java.lang.StringtoString()Deprecated.Returns a string representation of this array.static voidwriteJSONString(boolean[] array, java.io.Writer out)Deprecated.description omitted.static voidwriteJSONString(byte[] array, java.io.Writer out)Deprecated.description omitted.static voidwriteJSONString(char[] array, java.io.Writer out)Deprecated.description omitted.static voidwriteJSONString(double[] array, java.io.Writer out)Deprecated.description omitted.static voidwriteJSONString(float[] array, java.io.Writer out)Deprecated.description omitted.static voidwriteJSONString(int[] array, java.io.Writer out)Deprecated.description omitted.static voidwriteJSONString(long[] array, java.io.Writer out)Deprecated.description omitted.static voidwriteJSONString(short[] array, java.io.Writer out)Deprecated.description omitted.voidwriteJSONString(java.io.Writer out)Deprecated.write JSON string to out.static voidwriteJSONString(java.lang.Object[] array, java.io.Writer out)Deprecated.description omitted.static voidwriteJSONString(java.util.Collection collection, java.io.Writer out)Deprecated.Encode a list into JSON text and write it to out.-
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
-
-
-
Constructor Detail
-
JSONArray
public JSONArray()
Deprecated.Constructs an empty JSONArray.
-
JSONArray
public JSONArray(java.util.Collection c)
Deprecated.Constructs a JSONArray containing the elements of the specified collection, in the order they are returned by the collection's iterator.- Parameters:
c- the collection whose elements are to be placed into this JSONArray
-
-
Method Detail
-
writeJSONString
public static void writeJSONString(java.util.Collection collection, java.io.Writer out) throws java.io.IOException
Deprecated.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:
collection- description omitted.out- description omitted.- Throws:
java.io.IOException- description omitted.- See Also:
JSONValue.writeJSONString(Object, Writer)
-
writeJSONString
public void writeJSONString(java.io.Writer out) throws java.io.IOException
Deprecated.Description copied from interface:JSONStreamAwarewrite JSON string to out.- Specified by:
writeJSONStringin interfaceJSONStreamAware- Parameters:
out- description omitted.- Throws:
java.io.IOException- description omitted.
-
toJSONString
public static java.lang.String toJSONString(java.util.Collection collection)
Deprecated.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:
collection- description omitted.- Returns:
- JSON text, or "null" if list is null.
- See Also:
JSONValue.toJSONString(Object)
-
writeJSONString
public static void writeJSONString(byte[] array, java.io.Writer out) throws java.io.IOException
Deprecated.description omitted.- Parameters:
array- description omitted.out- description omitted.- Throws:
java.io.IOException- description omitted.
-
toJSONString
public static java.lang.String toJSONString(byte[] array)
Deprecated.description omitted.- Parameters:
array- description omitted.- Returns:
- description omitted.
-
writeJSONString
public static void writeJSONString(short[] array, java.io.Writer out) throws java.io.IOException
Deprecated.description omitted.- Parameters:
array- description omitted.out- description omitted.- Throws:
java.io.IOException- description omitted.
-
toJSONString
public static java.lang.String toJSONString(short[] array)
Deprecated.description omitted.- Parameters:
array- description omitted.- Returns:
- description omitted.
-
writeJSONString
public static void writeJSONString(int[] array, java.io.Writer out) throws java.io.IOException
Deprecated.description omitted.- Parameters:
array- description omitted.out- description omitted.- Throws:
java.io.IOException- description omitted.
-
toJSONString
public static java.lang.String toJSONString(int[] array)
Deprecated.description omitted.- Parameters:
array- description omitted.- Returns:
- description omitted.
-
writeJSONString
public static void writeJSONString(long[] array, java.io.Writer out) throws java.io.IOException
Deprecated.description omitted.- Parameters:
array- description omitted.out- description omitted.- Throws:
java.io.IOException- description omitted.
-
toJSONString
public static java.lang.String toJSONString(long[] array)
Deprecated.description omitted.- Parameters:
array- description omitted.- Returns:
- description omitted.
-
writeJSONString
public static void writeJSONString(float[] array, java.io.Writer out) throws java.io.IOException
Deprecated.description omitted.- Parameters:
array- description omitted.out- description omitted.- Throws:
java.io.IOException- description omitted.
-
toJSONString
public static java.lang.String toJSONString(float[] array)
Deprecated.description omitted.- Parameters:
array- description omitted.- Returns:
- description omitted.
-
writeJSONString
public static void writeJSONString(double[] array, java.io.Writer out) throws java.io.IOException
Deprecated.description omitted.- Parameters:
array- description omitted.out- description omitted.- Throws:
java.io.IOException- description omitted.
-
toJSONString
public static java.lang.String toJSONString(double[] array)
Deprecated.description omitted.- Parameters:
array- description omitted.- Returns:
- description omitted.
-
writeJSONString
public static void writeJSONString(boolean[] array, java.io.Writer out) throws java.io.IOException
Deprecated.description omitted.- Parameters:
array- description omitted.out- description omitted.- Throws:
java.io.IOException- description omitted.
-
toJSONString
public static java.lang.String toJSONString(boolean[] array)
Deprecated.description omitted.- Parameters:
array- description omitted.- Returns:
- description omitted.
-
writeJSONString
public static void writeJSONString(char[] array, java.io.Writer out) throws java.io.IOException
Deprecated.description omitted.- Parameters:
array- description omitted.out- description omitted.- Throws:
java.io.IOException- description omitted.
-
toJSONString
public static java.lang.String toJSONString(char[] array)
Deprecated.description omitted.- Parameters:
array- description omitted.- Returns:
- description omitted.
-
writeJSONString
public static void writeJSONString(java.lang.Object[] array, java.io.Writer out) throws java.io.IOException
Deprecated.description omitted.- Parameters:
array- description omitted.out- description omitted.- Throws:
java.io.IOException- description omitted.
-
toJSONString
public static java.lang.String toJSONString(java.lang.Object[] array)
Deprecated.description omitted.- Parameters:
array- description omitted.- Returns:
- description omitted.
-
toJSONString
public java.lang.String toJSONString()
Deprecated.- Specified by:
toJSONStringin interfaceJSONAware- Returns:
- JSON text
-
toString
public java.lang.String toString()
Deprecated.Returns a string representation of this array. This is equivalent to callingtoJSONString().- Overrides:
toStringin classjava.util.AbstractCollection
-
-