|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectin.srain.binpack.BinList
public class BinList
A Collection wrapper for data access.
| Constructor Summary | |
|---|---|
BinList(byte[] bs,
java.lang.String charsetName)
|
|
BinList(java.util.Collection copyFrom)
|
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object o)
|
java.lang.Object |
get(int index)
Returns the value at index. |
boolean |
getBoolean(int index)
Returns the value at index if it exists and is a boolean or can
be coerced to a boolean. |
byte |
getByte(int index)
Returns the value at index if it exists and is a byte or
can be coerced to an byte. |
BinDict |
getDict(int index)
|
double |
getDouble(int index)
Returns the value at index if it exists and is a double or can
be coerced to a double. |
int |
getInt(int index)
Returns the value at index if it exists and is an int or
can be coerced to an int. |
BinList |
getList(int index)
Returns the value at index if it exists and is a BinList. |
long |
getLong(int index)
Returns the value at index if it exists and is a long or
can be coerced to a long. |
short |
getShort(int index)
Returns the value at index if it exists and is a short or
can be coerced to an byte. |
java.lang.String |
getString(int index)
Returns the value at index if it exists, coercing it if
necessary. |
int |
hashCode()
|
boolean |
isNull(int index)
Returns true if this array has no value at index, or if its value
is the null reference or BinDict.NULL. |
int |
length()
Returns the number of values in this array. |
java.lang.Object |
opt(int index)
Returns the value at index, or null if the array has no value
at index. |
boolean |
optBoolean(int index)
Returns the value at index if it exists and is a boolean or can
be coerced to a boolean. |
boolean |
optBoolean(int index,
boolean fallback)
Returns the value at index if it exists and is a boolean or can
be coerced to a boolean. |
byte |
optByte(int index)
Returns the value at index if it exists and is a byte or
can be coerced to a byte. |
byte |
optByte(int index,
byte fallback)
Returns the value at index if it exists and is a byte or
can be coerced to a byte. |
BinDict |
optDict(int index)
|
double |
optDouble(int index)
Returns the value at index if it exists and is a double or can
be coerced to a double. |
double |
optDouble(int index,
double fallback)
Returns the value at index if it exists and is a double or can
be coerced to a double. |
int |
optInt(int index)
Returns the value at index if it exists and is an int or
can be coerced to an int. |
int |
optInt(int index,
int fallback)
Returns the value at index if it exists and is an int or
can be coerced to an int. |
BinList |
optList(int index)
Returns the value at index if it exists and is a BinList. |
long |
optLong(int index)
Returns the value at index if it exists and is a long or
can be coerced to a long. |
long |
optLong(int index,
long fallback)
Returns the value at index if it exists and is a long or
can be coerced to a long. |
short |
optShort(int index)
Returns the value at index if it exists and is a short or
can be coerced to a short. |
short |
optShort(int index,
short fallback)
Returns the value at index if it exists and is a short or
can be coerced to a short. |
java.lang.String |
optString(int index)
Returns the value at index if it exists, coercing it if
necessary. |
java.lang.String |
optString(int index,
java.lang.String fallback)
Returns the value at index if it exists, coercing it if
necessary. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public BinList(java.util.Collection copyFrom)
public BinList(byte[] bs,
java.lang.String charsetName)
throws BinPackException
BinPackException| Method Detail |
|---|
public int length()
public boolean isNull(int index)
index, or if its value
is the null reference or BinDict.NULL.
public java.lang.Object get(int index)
throws BinPackException
index.
BinPackException - if this array has no value at index, or if
that value is the null reference. This method returns
normally if the value is JSONObject#NULL.public java.lang.Object opt(int index)
index, or null if the array has no value
at index.
public boolean getBoolean(int index)
throws BinPackException
index if it exists and is a boolean or can
be coerced to a boolean.
BinPackException - if the value at index doesn't exist or
cannot be coerced to a boolean.public boolean optBoolean(int index)
index if it exists and is a boolean or can
be coerced to a boolean. Returns false otherwise.
public boolean optBoolean(int index,
boolean fallback)
index if it exists and is a boolean or can
be coerced to a boolean. Returns fallback otherwise.
public double getDouble(int index)
throws BinPackException
index if it exists and is a double or can
be coerced to a double.
BinPackException - if the value at index doesn't exist or
cannot be coerced to a double.public double optDouble(int index)
index if it exists and is a double or can
be coerced to a double. Returns NaN otherwise.
public double optDouble(int index,
double fallback)
index if it exists and is a double or can
be coerced to a double. Returns fallback otherwise.
public byte getByte(int index)
throws BinPackException
index if it exists and is a byte or
can be coerced to an byte.
BinPackException - if the value at index doesn't exist or
cannot be coerced to a byte.public byte optByte(int index)
index if it exists and is a byte or
can be coerced to a byte. Returns 0 otherwise.
public byte optByte(int index,
byte fallback)
index if it exists and is a byte or
can be coerced to a byte. Returns fallback otherwise.
public short getShort(int index)
throws BinPackException
index if it exists and is a short or
can be coerced to an byte.
BinPackException - if the value at index doesn't exist or
cannot be coerced to a short.public short optShort(int index)
index if it exists and is a short or
can be coerced to a short. Returns 0 otherwise.
public short optShort(int index,
short fallback)
index if it exists and is a short or
can be coerced to a short. Returns fallback otherwise.
public int getInt(int index)
throws BinPackException
index if it exists and is an int or
can be coerced to an int.
BinPackException - if the value at index doesn't exist or
cannot be coerced to an int.public int optInt(int index)
index if it exists and is an int or
can be coerced to an int. Returns 0 otherwise.
public int optInt(int index,
int fallback)
index if it exists and is an int or
can be coerced to an int. Returns fallback otherwise.
public long getLong(int index)
throws BinPackException
index if it exists and is a long or
can be coerced to a long.
BinPackException - if the value at index doesn't exist or
cannot be coerced to a long.public long optLong(int index)
index if it exists and is a long or
can be coerced to a long. Returns 0 otherwise.
public long optLong(int index,
long fallback)
index if it exists and is a long or
can be coerced to a long. Returns fallback otherwise.
public java.lang.String getString(int index)
throws BinPackException
index if it exists, coercing it if
necessary.
BinPackException - if no such value exists.public java.lang.String optString(int index)
index if it exists, coercing it if
necessary. Returns the empty string if no such value exists.
public java.lang.String optString(int index,
java.lang.String fallback)
index if it exists, coercing it if
necessary. Returns fallback if no such value exists.
public BinList getList(int index)
throws BinPackException
index if it exists and is a BinList.
BinPackException - if the value doesn't exist or is not a BinList.public BinList optList(int index)
index if it exists and is a BinList. Returns null otherwise.
public BinDict getDict(int index)
throws BinPackException
BinPackExceptionpublic BinDict optDict(int index)
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||