Package io.keikai.json
Class JSONArray<T>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList<T>
io.keikai.json.JSONArray<T>
- All Implemented Interfaces:
JSONAware,Serializable,Cloneable,Iterable<T>,Collection<T>,List<T>,RandomAccess
A JSON array. JSONObject supports java.util.List interface.
- Author:
- FangYidong<fangyidong@yahoo.com.cn>
- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionEncodes this object to a JSON string.static StringtoJSONString(boolean[] ary) Convert a boolean array to JSON text.static StringtoJSONString(byte[] ary) Convert a byte array to JSON text.static StringtoJSONString(char[] ary) Convert a char array to JSON text.static StringtoJSONString(double[] ary) Convert a double array to JSON text.static StringtoJSONString(float[] ary) Convert a float array to JSON text.static StringtoJSONString(int[] ary) Convert an integer array to JSON text.static StringtoJSONString(long[] ary) Convert a long array to JSON text.static StringtoJSONString(short[] ary) Convert a short array to JSON text.static StringtoJSONString(Object[] ary) Convert an object array to JSON text.static StringtoJSONString(Collection collection) Convert a list to JSON text.toString()Encodes this object to a JSON string.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, trimToSizeMethods inherited from class java.util.AbstractCollection
containsAllMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods 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
-
Constructor Details
-
JSONArray
public JSONArray() -
JSONArray
-
-
Method Details
-
toJSONString
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:
-
toJSONString
Convert an object array to JSON text.patched by tomyeh
-
toJSONString
Convert an integer array to JSON text.patched by tomyeh
-
toJSONString
Convert a long array to JSON text.patched by tomyeh
-
toJSONString
Convert a short array to JSON text.patched by tomyeh
-
toJSONString
Convert a float array to JSON text.patched by tomyeh
-
toJSONString
Convert a double array to JSON text.patched by tomyeh
-
toJSONString
Convert a byte array to JSON text.patched by tomyeh
-
toJSONString
Convert a boolean array to JSON text.patched by tomyeh
-
toJSONString
Convert a char array to JSON text.patched by tomyeh
-
toJSONString
Encodes this object to a JSON string. It is the same astoString().- Specified by:
toJSONStringin interfaceJSONAware- Returns:
- JSON text
-
toString
Encodes this object to a JSON string. It is the same astoJSONString().- Overrides:
toStringin classAbstractCollection<T>
-