AndBase开发框架  1.6
 全部  命名空间 文件 函数 变量 枚举值 
Public 成员函数 | Private 属性 | 所有成员列表
com.google.gson.JsonArray类 参考
类 com.google.gson.JsonArray 继承关系图:
com.google.gson.JsonElement

Public 成员函数

 JsonArray ()
 
void add (JsonElement element)
 
void addAll (JsonArray array)
 
int size ()
 
Iterator< JsonElementiterator ()
 
JsonElement get (int i)
 
Number getAsNumber ()
 
String getAsString ()
 
double getAsDouble ()
 
BigDecimal getAsBigDecimal ()
 
BigInteger getAsBigInteger ()
 
float getAsFloat ()
 
long getAsLong ()
 
int getAsInt ()
 
byte getAsByte ()
 
char getAsCharacter ()
 
short getAsShort ()
 
boolean getAsBoolean ()
 
boolean equals (Object o)
 
int hashCode ()
 
- Public 成员函数 继承自 com.google.gson.JsonElement
boolean isJsonArray ()
 
boolean isJsonObject ()
 
boolean isJsonPrimitive ()
 
boolean isJsonNull ()
 
JsonObject getAsJsonObject ()
 
JsonArray getAsJsonArray ()
 
JsonPrimitive getAsJsonPrimitive ()
 
JsonNull getAsJsonNull ()
 
boolean getAsBoolean ()
 
Number getAsNumber ()
 
String getAsString ()
 
double getAsDouble ()
 
float getAsFloat ()
 
long getAsLong ()
 
int getAsInt ()
 
byte getAsByte ()
 
char getAsCharacter ()
 
BigDecimal getAsBigDecimal ()
 
BigInteger getAsBigInteger ()
 
short getAsShort ()
 
String toString ()
 

Private 属性

final List< JsonElementelements
 

额外继承的成员函数

- 包函数 继承自 com.google.gson.JsonElement
Boolean getAsBooleanWrapper ()
 

详细描述

A class representing an array type in Json. An array is a list of JsonElements each of which can be of a different type. This is an ordered list, meaning that the order in which elements are added is preserved.

作者
Inderjeet Singh
Joel Leitch

构造及析构函数说明

com.google.gson.JsonArray.JsonArray ( )
inline

Creates an empty JsonArray.

成员函数说明

void com.google.gson.JsonArray.add ( JsonElement  element)
inline

Adds the specified element to self.

参数
elementthe element that needs to be added to the array.
void com.google.gson.JsonArray.addAll ( JsonArray  array)
inline

Adds all the elements of the specified array to self.

参数
arraythe array whose elements need to be added to the array.
boolean com.google.gson.JsonArray.equals ( Object  o)
inline
JsonElement com.google.gson.JsonArray.get ( int  i)
inline

Returns the ith element of the array.

参数
ithe index of the element that is being sought.
返回
the element present at the ith index.
异常
IndexOutOfBoundsExceptionif i is negative or greater than or equal to the size() of the array.
BigDecimal com.google.gson.JsonArray.getAsBigDecimal ( )
inline

convenience method to get this array as a BigDecimal if it contains a single element.

返回
get this element as a BigDecimal if it is single element array.
异常
ClassCastExceptionif the element in the array is of not a JsonPrimitive.
NumberFormatExceptionif the element at index 0 is not a valid BigDecimal.
IllegalStateExceptionif the array has more than one element.
自从
1.2
BigInteger com.google.gson.JsonArray.getAsBigInteger ( )
inline

convenience method to get this array as a BigInteger if it contains a single element.

返回
get this element as a BigInteger if it is single element array.
异常
ClassCastExceptionif the element in the array is of not a JsonPrimitive.
NumberFormatExceptionif the element at index 0 is not a valid BigInteger.
IllegalStateExceptionif the array has more than one element.
自从
1.2
boolean com.google.gson.JsonArray.getAsBoolean ( )
inline

convenience method to get this array as a boolean if it contains a single element.

返回
get this element as a boolean if it is single element array.
异常
ClassCastExceptionif the element in the array is of not a JsonPrimitive and is not a valid boolean.
IllegalStateExceptionif the array has more than one element.
byte com.google.gson.JsonArray.getAsByte ( )
inline
char com.google.gson.JsonArray.getAsCharacter ( )
inline
double com.google.gson.JsonArray.getAsDouble ( )
inline

convenience method to get this array as a double if it contains a single element.

返回
get this element as a double if it is single element array.
异常
ClassCastExceptionif the element in the array is of not a JsonPrimitive and is not a valid double.
IllegalStateExceptionif the array has more than one element.
float com.google.gson.JsonArray.getAsFloat ( )
inline

convenience method to get this array as a float if it contains a single element.

返回
get this element as a float if it is single element array.
异常
ClassCastExceptionif the element in the array is of not a JsonPrimitive and is not a valid float.
IllegalStateExceptionif the array has more than one element.
int com.google.gson.JsonArray.getAsInt ( )
inline

convenience method to get this array as an integer if it contains a single element.

返回
get this element as an integer if it is single element array.
异常
ClassCastExceptionif the element in the array is of not a JsonPrimitive and is not a valid integer.
IllegalStateExceptionif the array has more than one element.
long com.google.gson.JsonArray.getAsLong ( )
inline

convenience method to get this array as a long if it contains a single element.

返回
get this element as a long if it is single element array.
异常
ClassCastExceptionif the element in the array is of not a JsonPrimitive and is not a valid long.
IllegalStateExceptionif the array has more than one element.
Number com.google.gson.JsonArray.getAsNumber ( )
inline

convenience method to get this array as a Number if it contains a single element.

返回
get this element as a number if it is single element array.
异常
ClassCastExceptionif the element in the array is of not a JsonPrimitive and is not a valid Number.
IllegalStateExceptionif the array has more than one element.
short com.google.gson.JsonArray.getAsShort ( )
inline

convenience method to get this array as a primitive short if it contains a single element.

返回
get this element as a primitive short if it is single element array.
异常
ClassCastExceptionif the element in the array is of not a JsonPrimitive and is not a valid short.
IllegalStateExceptionif the array has more than one element.
String com.google.gson.JsonArray.getAsString ( )
inline

convenience method to get this array as a String if it contains a single element.

返回
get this element as a String if it is single element array.
异常
ClassCastExceptionif the element in the array is of not a JsonPrimitive and is not a valid String.
IllegalStateExceptionif the array has more than one element.
int com.google.gson.JsonArray.hashCode ( )
inline
Iterator<JsonElement> com.google.gson.JsonArray.iterator ( )
inline

Returns an iterator to navigate the elemetns of the array. Since the array is an ordered list, the iterator navigates the elements in the order they were inserted.

返回
an iterator to navigate the elements of the array.
int com.google.gson.JsonArray.size ( )
inline

Returns the number of elements in the array.

返回
the number of elements in the array.

类成员变量说明

final List<JsonElement> com.google.gson.JsonArray.elements
private

该类的文档由以下文件生成: