Package com.alibaba.fastjson
Class JSONArray
java.lang.Object
com.alibaba.fastjson.JSON
com.alibaba.fastjson.JSONArray
- All Implemented Interfaces:
Serializable,Cloneable,Iterable,Collection,List
- See Also:
-
Field Summary
Fields inherited from class com.alibaba.fastjson.JSON
DEFAULT_GENERATE_FEATURE, DEFAULT_PARSER_FEATURE, DEFAULT_TYPE_KEY, defaultLocale, defaultTimeZone, DEFFAULT_DATE_FORMAT, VERSION -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int index, Collection c) booleanaddAll(Collection c) voidclear()clone()booleanbooleanbooleanfluentAddAll(Collection<?> c) fluentRemove(int index) fluentRemoveAll(Collection<?> c) get(int index) getBigDecimal(int index) getBigInteger(int index) getBoolean(int index) booleangetBooleanValue(int index) getByte(int index) bytegetByteValue(int index) Returns a byte value at the specified location in thisJSONArray.getDate(int index) getDouble(int index) doublegetDoubleValue(int index) Returns a double value at the specified location in thisJSONArray.getFloat(int index) floatgetFloatValue(int index) Returns a float value at the specified location in thisJSONArray.getInteger(int index) intgetIntValue(int index) getJSONArray(int index) getJSONObject(int index) getLong(int index) longgetLongValue(int index) <T> TgetShort(int index) shortgetShortValue(int index) Returns a short value at the specified location in thisJSONArray.getString(int index) inthashCode()intbooleanisEmpty()iterator()intlistIterator(int index) remove(int index) booleanbooleanbooleanintsize()subList(int fromIndex, int toIndex) Object[]toArray()Object[]<T> List<T>toJavaList(Class<T> clazz) <T> TtoJavaObject(Class<T> clazz) toString()Methods inherited from class com.alibaba.fastjson.JSON
config, config, configFilter, isValid, isValidArray, parse, parse, parse, parseArray, parseArray, parseArray, parseArray, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, parseObject, toJavaObject, toJSON, toJSONBytes, toJSONBytes, toJSONBytes, toJSONBytes, toJSONString, toJSONString, toJSONString, toJSONString, toJSONString, toJSONString, toJSONString, toJSONString, toJSONString, toJSONStringWithDateFormat, writeJSONString, writeJSONString, writeJSONStringMethods 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
replaceAll, sort, spliterator
-
Constructor Details
-
JSONArray
public JSONArray() -
JSONArray
-
JSONArray
public JSONArray(int initialCapacity)
-
-
Method Details
-
getByte
-
getShort
-
getFloat
-
getDouble
-
getIntValue
public int getIntValue(int index) -
getBigDecimal
-
getLongValue
public long getLongValue(int index) -
getInteger
-
getLong
-
getBooleanValue
public boolean getBooleanValue(int index) -
getBoolean
-
getJSONObject
-
size
public int size()- Specified by:
sizein interfaceCollection- Specified by:
sizein interfaceList
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection- Specified by:
isEmptyin interfaceList
-
contains
- Specified by:
containsin interfaceCollection- Specified by:
containsin interfaceList
-
iterator
-
toArray
- Specified by:
toArrayin interfaceCollection- Specified by:
toArrayin interfaceList
-
toArray
- Specified by:
toArrayin interfaceCollection- Specified by:
toArrayin interfaceList
-
add
- Specified by:
addin interfaceCollection- Specified by:
addin interfaceList
-
remove
- Specified by:
removein interfaceCollection- Specified by:
removein interfaceList
-
addAll
- Specified by:
addAllin interfaceCollection- Specified by:
addAllin interfaceList
-
addAll
-
clear
public void clear()- Specified by:
clearin interfaceCollection- Specified by:
clearin interfaceList
-
fluentClear
-
fluentRemove
-
fluentRemove
-
fluentSet
-
fluentRemoveAll
-
fluentAddAll
-
getShortValue
public short getShortValue(int index) Returns a short value at the specified location in thisJSONArray.- Parameters:
index- index of the element to return- Returns:
- short
- Throws:
NumberFormatException- If the value of get isStringand it contains no parsable shortJSONException- Unsupported type conversion to short valueIndexOutOfBoundsException- if the index is out of range(index < 0 || index >= size())
-
getFloatValue
public float getFloatValue(int index) Returns a float value at the specified location in thisJSONArray.- Parameters:
index- index of the element to return- Returns:
- float
- Throws:
NumberFormatException- If the value of get isStringand it contains no parsable floatJSONException- Unsupported type conversion to float valueIndexOutOfBoundsException- if the index is out of range(index < 0 || index >= size())
-
getDoubleValue
public double getDoubleValue(int index) Returns a double value at the specified location in thisJSONArray.- Parameters:
index- index of the element to return- Returns:
- double
- Throws:
NumberFormatException- If the value of get isStringand it contains no parsable doubleJSONException- Unsupported type conversion to double valueIndexOutOfBoundsException- if the index is out of range(index < 0 || index >= size())
-
retainAll
- Specified by:
retainAllin interfaceCollection- Specified by:
retainAllin interfaceList
-
removeAll
- Specified by:
removeAllin interfaceCollection- Specified by:
removeAllin interfaceList
-
containsAll
- Specified by:
containsAllin interfaceCollection- Specified by:
containsAllin interfaceList
-
get
-
getByteValue
public byte getByteValue(int index) Returns a byte value at the specified location in thisJSONArray.- Parameters:
index- index of the element to return- Returns:
- byte
- Throws:
NumberFormatException- If the value of get isStringand it contains no parsable byteJSONException- Unsupported type conversion to byte valueIndexOutOfBoundsException- if the index is out of range(index < 0 || index >= size())
-
getBigInteger
-
getDate
-
set
-
add
-
remove
-
indexOf
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceList
-
listIterator
- Specified by:
listIteratorin interfaceList
-
listIterator
- Specified by:
listIteratorin interfaceList
-
subList
-
getString
-
getJSONArray
-
getObject
-
toJavaList
-
fluentAdd
-
toJavaObject
-
toString
-
clone
-
hashCode
public int hashCode() -
equals
-