public class JSONArray extends ArrayList implements JSONAware, JSONStreamAware
modCount
Constructor and Description |
---|
JSONArray()
Constructs an empty JSONArray.
|
JSONArray(Collection c)
Constructs a JSONArray containing the elements of the specified
collection, in the order they are returned by the collection's iterator.
|
Modifier and Type | Method and Description |
---|---|
String |
toJSONString() |
static String |
toJSONString(boolean[] array) |
static String |
toJSONString(byte[] array) |
static String |
toJSONString(char[] array) |
static String |
toJSONString(Collection collection)
Convert a list to JSON text.
|
static String |
toJSONString(double[] array) |
static String |
toJSONString(float[] array) |
static String |
toJSONString(int[] array) |
static String |
toJSONString(long[] array) |
static String |
toJSONString(Object[] array) |
static String |
toJSONString(short[] array) |
String |
toString()
Returns a string representation of this array.
|
static void |
writeJSONString(boolean[] array,
Writer out) |
static void |
writeJSONString(byte[] array,
Writer out) |
static void |
writeJSONString(char[] array,
Writer out) |
static void |
writeJSONString(Collection collection,
Writer out)
Encode a list into JSON text and write it to out.
|
static void |
writeJSONString(double[] array,
Writer out) |
static void |
writeJSONString(float[] array,
Writer out) |
static void |
writeJSONString(int[] array,
Writer out) |
static void |
writeJSONString(long[] array,
Writer out) |
static void |
writeJSONString(Object[] array,
Writer out) |
static void |
writeJSONString(short[] array,
Writer out) |
void |
writeJSONString(Writer out)
write JSON string to out.
|
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
equals, hashCode
containsAll
finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode
parallelStream, stream
public JSONArray()
public JSONArray(Collection c)
c
- the collection whose elements are to be placed into this JSONArraypublic static void writeJSONString(Collection collection, Writer out) throws IOException
collection
- out
- IOException
JSONValue.writeJSONString(Object, Writer)
public void writeJSONString(Writer out) throws IOException
JSONStreamAware
writeJSONString
in interface JSONStreamAware
IOException
public static String toJSONString(Collection collection)
collection
- JSONValue.toJSONString(Object)
public static void writeJSONString(byte[] array, Writer out) throws IOException
IOException
public static String toJSONString(byte[] array)
public static void writeJSONString(short[] array, Writer out) throws IOException
IOException
public static String toJSONString(short[] array)
public static void writeJSONString(int[] array, Writer out) throws IOException
IOException
public static String toJSONString(int[] array)
public static void writeJSONString(long[] array, Writer out) throws IOException
IOException
public static String toJSONString(long[] array)
public static void writeJSONString(float[] array, Writer out) throws IOException
IOException
public static String toJSONString(float[] array)
public static void writeJSONString(double[] array, Writer out) throws IOException
IOException
public static String toJSONString(double[] array)
public static void writeJSONString(boolean[] array, Writer out) throws IOException
IOException
public static String toJSONString(boolean[] array)
public static void writeJSONString(char[] array, Writer out) throws IOException
IOException
public static String toJSONString(char[] array)
public static void writeJSONString(Object[] array, Writer out) throws IOException
IOException
public String toJSONString()
toJSONString
in interface JSONAware
public String toString()
toJSONString()
.toString
in class AbstractCollection