|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectin.srain.binpack.BinDict
public class BinDict
A map wrapper to access data.
| Field Summary | |
|---|---|
static java.lang.Object |
NULL
A sentinel value used to explicitly define a name with no value. |
| Constructor Summary | |
|---|---|
BinDict(byte[] bs,
java.lang.String charsetName)
|
|
BinDict(java.util.Map copyFrom)
|
|
| Method Summary | |
|---|---|
java.lang.Object |
get(java.lang.String name)
|
boolean |
getBoolean(java.lang.String name)
|
byte |
getByte(java.lang.String name)
Returns the value mapped by name if it exists and is a byte or
can be coerced to a byte. |
BinDict |
getDict(java.lang.String name)
|
double |
getDouble(java.lang.String name)
|
int |
getInt(java.lang.String name)
Returns the value mapped by name if it exists and is an int or
can be coerced to an int. |
BinList |
getList(java.lang.String name)
|
long |
getLong(java.lang.String name)
Returns the value mapped by name if it exists and is a long or
can be coerced to a long. |
short |
getShort(java.lang.String name)
Returns the value mapped by name if it exists and is a short or
can be coerced to a short. |
java.lang.String |
getString(java.lang.String name)
Returns the value mapped by name if it exists, coercing it if
necessary. |
boolean |
has(java.lang.String name)
|
boolean |
isNull(java.lang.String name)
|
java.util.Iterator |
keys()
|
java.util.ArrayList<java.lang.String> |
names()
Returns an array containing the string names in this object. |
java.lang.Object |
opt(java.lang.String name)
|
boolean |
optBoolean(java.lang.String name)
|
boolean |
optBoolean(java.lang.String name,
boolean fallback)
|
byte |
optByte(java.lang.String index)
Returns the value at index if it exists and is a byte or
can be coerced to a byte. |
byte |
optByte(java.lang.String name,
byte fallback)
Returns the value mapped by name if it exists and is a byte or
can be coerced to a byte. |
BinDict |
optDict(java.lang.String name)
|
double |
optDouble(java.lang.String name)
Returns the value mapped by name if it exists and is a double or
can be coerced to a double. |
double |
optDouble(java.lang.String name,
double fallback)
Returns the value mapped by name if it exists and is a double or
can be coerced to a double. |
int |
optInt(java.lang.String name)
Returns the value mapped by name if it exists and is an int or
can be coerced to an int. |
int |
optInt(java.lang.String name,
int fallback)
Returns the value mapped by name if it exists and is an int or
can be coerced to an int. |
BinList |
optList(java.lang.String name)
|
long |
optLong(java.lang.String name)
Returns the value mapped by name if it exists and is a long or
can be coerced to a long. |
long |
optLong(java.lang.String name,
long fallback)
Returns the value mapped by name if it exists and is a long or
can be coerced to a long. |
short |
optShort(java.lang.String name)
Returns the value mapped by name if it exists and is a short or
can be coerced to a short. |
short |
optShort(java.lang.String name,
short fallback)
Returns the value mapped by name if it exists and is a short or
can be coerced to a short Returns fallback otherwise. |
java.lang.String |
optString(java.lang.String name)
Returns the value mapped by name if it exists, coercing it if
necessary. |
java.lang.String |
optString(java.lang.String name,
java.lang.String fallback)
Returns the value mapped by name if it exists, coercing it if
necessary. |
int |
size()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.Object NULL
| Constructor Detail |
|---|
public BinDict(java.util.Map copyFrom)
public BinDict(byte[] bs,
java.lang.String charsetName)
throws BinPackException
BinPackException| Method Detail |
|---|
public boolean isNull(java.lang.String name)
public boolean has(java.lang.String name)
public java.lang.Object get(java.lang.String name)
throws BinPackException
BinPackExceptionpublic java.lang.Object opt(java.lang.String name)
public boolean getBoolean(java.lang.String name)
throws BinPackException
BinPackExceptionpublic boolean optBoolean(java.lang.String name)
public boolean optBoolean(java.lang.String name,
boolean fallback)
public double getDouble(java.lang.String name)
throws BinPackException
BinPackExceptionpublic double optDouble(java.lang.String name)
name if it exists and is a double or
can be coerced to a double. Returns NaN otherwise.
public double optDouble(java.lang.String name,
double fallback)
name if it exists and is a double or
can be coerced to a double. Returns fallback otherwise.
public byte getByte(java.lang.String name)
throws BinPackException
name if it exists and is a byte or
can be coerced to a byte.
BinPackException - if the mapping doesn't exist or cannot be coerced
to a byte.public byte optByte(java.lang.String index)
index if it exists and is a byte or
can be coerced to a byte. Returns 0 otherwise.
public byte optByte(java.lang.String name,
byte fallback)
name if it exists and is a byte or
can be coerced to a byte. Returns fallback otherwise.
public short getShort(java.lang.String name)
throws BinPackException
name if it exists and is a short or
can be coerced to a short.
BinPackException - if the mapping doesn't exist or cannot be coerced
to a short.public short optShort(java.lang.String name)
name if it exists and is a short or
can be coerced to a short. Returns 0 otherwise.
public short optShort(java.lang.String name,
short fallback)
name if it exists and is a short or
can be coerced to a short Returns fallback otherwise.
public int getInt(java.lang.String name)
throws BinPackException
name if it exists and is an int or
can be coerced to an int.
BinPackException - if the mapping doesn't exist or cannot be coerced
to an int.public int optInt(java.lang.String name)
name if it exists and is an int or
can be coerced to an int. Returns 0 otherwise.
public int optInt(java.lang.String name,
int fallback)
name if it exists and is an int or
can be coerced to an int. Returns fallback otherwise.
public long getLong(java.lang.String name)
throws BinPackException
name if it exists and is a long or
can be coerced to a long.
BinPackException - if the mapping doesn't exist or cannot be coerced
to a long.public long optLong(java.lang.String name)
name if it exists and is a long or
can be coerced to a long. Returns 0 otherwise.
public long optLong(java.lang.String name,
long fallback)
name if it exists and is a long or
can be coerced to a long. Returns fallback otherwise.
public java.lang.String getString(java.lang.String name)
throws BinPackException
name if it exists, coercing it if
necessary.
BinPackException - if no such mapping exists.public java.lang.String optString(java.lang.String name)
name if it exists, coercing it if
necessary. Returns the empty string if no such mapping exists.
public java.lang.String optString(java.lang.String name,
java.lang.String fallback)
name if it exists, coercing it if
necessary. Returns fallback if no such mapping exists.
public BinList getList(java.lang.String name)
throws BinPackException
BinPackExceptionpublic BinList optList(java.lang.String name)
public BinDict getDict(java.lang.String name)
throws BinPackException
BinPackExceptionpublic BinDict optDict(java.lang.String name)
public java.util.Iterator keys()
public int size()
public java.util.ArrayList<java.lang.String> names()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||