Package org.jfree.data.json.impl
Class JSONArray
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList
-
- org.jfree.data.json.impl.JSONArray
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Iterable,java.util.Collection,java.util.List,java.util.RandomAccess,JSONAware,JSONStreamAware
public class JSONArray extends java.util.ArrayList implements java.util.List, JSONAware, JSONStreamAware
A JSON array.
This class is for internal use by JFreeChart, it is not part of the supported API and you should not call it directly. If you need JSON support in your project you should include JSON.simple (https://code.google.com/p/json-simple/) or some other JSON library directly in your project.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description JSONArray()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringtoJSONString()Returns a JSON string representation of this list.static java.lang.StringtoJSONString(java.util.List list)Convert a list to JSON text.java.lang.StringtoString()Returns a string representation of this list.voidwriteJSONString(java.io.Writer out)Writes this array to the specified output writer.static voidwriteJSONString(java.util.List list, java.io.Writer out)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, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
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, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Method Detail
-
writeJSONString
public static void writeJSONString(java.util.List list, java.io.Writer out) throws java.io.IOExceptionEncode a list into JSON text and write it to out. If this list is also aJSONStreamAwareor aJSONAware,JSONStreamAwareandJSONAwarespecific behaviours will be ignored at this top level.- Parameters:
list- the list (nullpermitted).out- the output writer (nullnot permitted).- Throws:
java.io.IOException- if there is an I/O problem.- See Also:
JSONValue.writeJSONString(Object, Writer)
-
writeJSONString
public void writeJSONString(java.io.Writer out) throws java.io.IOExceptionWrites this array to the specified output writer.- Specified by:
writeJSONStringin interfaceJSONStreamAware- Parameters:
out- the output writer (nullnot permitted).- Throws:
java.io.IOException- if there is an I/O problem.
-
toJSONString
public static java.lang.String toJSONString(java.util.List list)
Convert a list to JSON text. The result is a JSON array. If this list is also aJSONAware,JSONAwarespecific behaviours will be omitted at this top level.- Parameters:
list- the list (nullpermitted).- Returns:
- JSON text, or "null" if list is null.
- See Also:
JSONValue.toJSONString(Object)
-
toJSONString
public java.lang.String toJSONString()
Returns a JSON string representation of this list.- Specified by:
toJSONStringin interfaceJSONAware- Returns:
- A string.
-
toString
public java.lang.String toString()
Returns a string representation of this list.- Overrides:
toStringin classjava.util.AbstractCollection- Returns:
- A string.
-
-