|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.util.Hashtable
net.rim.device.api.io.parser.ObjectPathHashtableBase
public abstract class ObjectPathHashtableBase
Base class for both XMLHashtable and JSONHashtable. It
provides common functionality for both classes, and adds type-safe methods for extracting data from a
Hashtable.
| Method Summary | ||
|---|---|---|
void |
addString(String key,
String value)
Adds a String value at the key specified. |
|
boolean |
getBoolean(String key)
Indicates whether the value associated with a key is equal to the string "true". |
|
boolean |
getBoolean(String key,
boolean defaultValue)
Indicates whether the value associated with a key is equal to the string "true". |
|
boolean[] |
getBooleanArray(String key)
Returns an array of boolean values associated with the key specified. |
|
boolean |
getBooleanAt(String key,
int index)
Indicates whether the value associated with a key is equal to the string "true". |
|
boolean |
getBooleanAt(String key,
int index,
boolean defaultValue)
Indicates whether the value associated with a key is equal to the string "true". |
|
byte |
getByte(String key)
Returns a byte value that corresponds to a given key. |
|
byte |
getByte(String key,
byte defaultValue)
Returns an byte value that corresponds to a given key. |
|
byte[] |
getByteArray(String key)
Returns an array of byte values associated with the key specified. |
|
byte |
getByteAt(String key,
int index)
Returns a byte value that corresponds to a given key. |
|
byte |
getByteAt(String key,
int index,
byte defaultValue)
Returns a byte value that corresponds to a given key. |
|
double |
getDouble(String key)
Returns a double value that corresponds to a given key. |
|
double |
getDouble(String key,
double defaultValue)
Returns a double value that corresponds to a given key. |
|
double[] |
getDoubleArray(String key)
Returns an array of double values associated with the key specified. |
|
double |
getDoubleAt(String key,
int index)
Returns a double value that corresponds to a given key. |
|
double |
getDoubleAt(String key,
int index,
double defaultValue)
Returns a double value that corresponds to a given key. |
|
float |
getFloat(String key)
Returns a float value that corresponds to a given key. |
|
float |
getFloat(String key,
float defaultValue)
Returns an float value that corresponds to a given key. |
|
float[] |
getFloatArray(String key)
Returns an array of float values associated with the key specified. |
|
float |
getFloatAt(String key,
int index)
Returns a float value that corresponds to a given key. |
|
float |
getFloatAt(String key,
int index,
float defaultValue)
Returns a float value that corresponds to a given key. |
|
int |
getInteger(String key)
Returns an int value that corresponds to a given key. |
|
int |
getInteger(String key,
int defaultValue)
Returns an int value that corresponds to a given key. |
|
int |
getInteger(String key,
int defaultValue,
int radix)
Returns an int value that corresponds to a given key. |
|
int[] |
getIntegerArray(String key)
Returns an array of int values associated with the key specified. |
|
int |
getIntegerAt(String key,
int index)
Returns an int value that corresponds to a given key. |
|
int |
getIntegerAt(String key,
int index,
int defaultValue)
Returns an int value that corresponds to a given key. |
|
int |
getIntegerAt(String key,
int index,
int defaultValue,
int radix)
Returns an int value that corresponds to a given key. |
|
long |
getLong(String key)
Returns a long value that corresponds to a given key. |
|
long |
getLong(String key,
long defaultValue)
Returns a long value that corresponds to a given key. |
|
long[] |
getLongArray(String key)
Returns an array of long values associated with the key specified. |
|
long |
getLongAt(String key,
int index)
Returns a long value that corresponds to a given key. |
|
long |
getLongAt(String key,
int index,
long defaultValue)
Returns a long value that corresponds to a given key. |
|
int |
getNumKeys(String key)
Returns the number of times a key occurs in a document. |
|
int |
getNumValues(String key)
Returns the number of values in the document that correspond to the path specified. |
|
short |
getShort(String key)
Returns a short value that corresponds to a given key. |
|
short |
getShort(String key,
short defaultValue)
Returns a short value that corresponds to a given key. |
|
short[] |
getShortArray(String key)
Returns an array of short values associated with the key specified. |
|
short |
getShortAt(String key,
int index)
Returns a float value that corresponds to a given key. |
|
short |
getShortAt(String key,
int index,
short defaultValue)
Returns a short value that corresponds to a given key. |
|
String |
getString(String key)
Returns the String value associated with a key. |
|
String |
getString(String key,
String defaultValue)
Returns the String value associated with a key. |
|
String[] |
getStringArray(String key)
Returns an array of String values associated with the key specified. |
|
String |
getStringAt(String key,
int index)
Returns the String value associated with a key. |
|
String |
getStringAt(String key,
int index,
String defaultValue)
Returns the String value associated with the key at a given index. |
|
| Methods inherited from class java.util.Hashtable |
|---|
clear, contains, containsKey, elements, get, isEmpty, keys, put, rehash, remove, size, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public int getNumKeys(String key)
getNumKeys in interface ObjectPathHashtablekey - Path to an element in a document.
public int getNumValues(String key)
getNumValues in interface ObjectPathHashtablekey - Path to element in document
public String getStringAt(String key,
int index,
String defaultValue)
ObjectPathHashtableString value associated with the key at a given index.
If there is more than one value associated with the key, then the first one is returned.
If the key is not found, then the default value is returned.
getStringAt in interface ObjectPathHashtablekey - Path to an element in the document.index - Zero-based index into an array. A value of 0 should be used if not querying an array.defaultValue - Value to return if no value is found for the key in the Hashtable.
defaultValue if no value is available.ObjectPathHashtable.getStringAt(String, int, String)
public String getString(String key,
String defaultValue)
ObjectPathHashtableString value associated with a key. If there is
more than one value associated with the key, then the first one is returned.
If the key is not found, then the defaultValue is returned.
getString in interface ObjectPathHashtablekey - Path to an element in document.defaultValue - Value to return if no value is found for the key in the Hashtable.
defaultValue if no value is available.ObjectPathHashtable.getString(String, String)
public String getStringAt(String key,
int index)
ObjectPathHashtableString value associated with a key. If there is
more than one value associated with the key, then the first one is returned.
If the key is not found, then the defaultValue is returned.
getStringAt in interface ObjectPathHashtablekey - Path to an element in document.index - Zero-based index into an array. A value of 0 should be used if not querying an array.
null if no value is available.ObjectPathHashtable.getStringAt(String, int)public String getString(String key)
ObjectPathHashtableString value associated with a key. If there is
more than one value associated with the key, then the first one is returned.
If the key is not found, then the defaultValue is returned.
getString in interface ObjectPathHashtablekey - Path to an element in document.
null if no value is available.ObjectPathHashtable.getString(String)public String[] getStringArray(String key)
ObjectPathHashtableString values associated with the key specified.
getStringArray will do the following if it encounters something other
than a String array for the key specified:
Vector: will be converted to a String array.
String: will return an array with a single entry.
String object: a single element array with the output of the object's toString method.
If the key is not found, then null is returned.
getStringArray in interface ObjectPathHashtablekey - Path to an element in the document.
String values corresponding to this key, or null if no value is available.ObjectPathHashtable.getStringArray(String)
public boolean getBooleanAt(String key,
int index,
boolean defaultValue)
ObjectPathHashtable
getBooleanAt in interface ObjectPathHashtablekey - Path to an element in the document.index - Zero-based index into an array. A value of 0 should be used if not querying an array.defaultValue - Value to return if no value is found for the key in the Hashtable.
defaultValue if no value is available.ObjectPathHashtable.getBooleanAt(String, int, boolean)
public boolean getBoolean(String key,
boolean defaultValue)
ObjectPathHashtable
getBoolean in interface ObjectPathHashtablekey - Path to an element in the document.defaultValue - Value to return if no value is found for the key in the Hashtable.
defaultValue if no value is available.ObjectPathHashtable.getBoolean(String,boolean)
public boolean getBooleanAt(String key,
int index)
ObjectPathHashtablefalse is returned.
getBooleanAt in interface ObjectPathHashtablekey - Path to an element in the document.index - Zero-based index into an array. A value of 0 should be used if not querying an array.
false if no value is available.ObjectPathHashtable.getBooleanAt(String,int)public boolean getBoolean(String key)
ObjectPathHashtablefalse is returned.
getBoolean in interface ObjectPathHashtablekey - Path to an element in the document.
false if no value is available.ObjectPathHashtable.getBoolean(String)public boolean[] getBooleanArray(String key)
ObjectPathHashtableboolean values associated with the key specified.
getBooleanArray will do the following if it encounters something other
than a boolean array for the key specified:
Vector: will be converted to a boolean array.
boolean: will return an array with a single entry.
String object: a single element array with the output
of Boolean.pasrseBoolean; the output of the object's
toString method is passed to parseBoolean.
If the key is not found, then null is returned.
getBooleanArray in interface ObjectPathHashtablekey - Path to an element in the document.
boolean values corresponding to this key, or null if no value is available.ObjectPathHashtable.getBooleanArray(String)
public int getIntegerAt(String key,
int index,
int defaultValue,
int radix)
ObjectPathHashtableint value that corresponds to a given key. If there
is no value at the key specified, the default value is returned.
getIntegerAt in interface ObjectPathHashtablekey - Path to an element in the document.index - Zero-based index into an array. A value of 0 should be used if not querying an array.defaultValue - Value to return if no value is found for the key in the Hashtable.radix - Radix to use when converting from a String to an int.
defaultValue if no value is available.ObjectPathHashtable.getIntegerAt(String,int,int,int)
public int getIntegerAt(String key,
int index,
int defaultValue)
ObjectPathHashtableint value that corresponds to a given key. If there
is no value at the key specified, the default value is returned.
getIntegerAt in interface ObjectPathHashtablekey - Path to an element in the document.index - Zero-based index into an array. A value of 0 should be used if not querying an array.defaultValue - Value to return if no value is found for the key in the Hashtable.
defaultValue if no value is available.ObjectPathHashtable.getIntegerAt(String,int,int)
public int getInteger(String key,
int defaultValue,
int radix)
ObjectPathHashtableint value that corresponds to a given key. If there
is no value at the key specified, the default value is returned.
getInteger in interface ObjectPathHashtablekey - Path to an element in the document.defaultValue - Value to return if no value is found for the key in the Hashtable.radix - Radix to use when converting from a String to an int.
defaultValue if no value is available.ObjectPathHashtable.getInteger(String,int,int)
public int getInteger(String key,
int defaultValue)
ObjectPathHashtableint value that corresponds to a given key. If there
is no value at the key specified, the default value is returned.
getInteger in interface ObjectPathHashtablekey - Path to an element in the document.defaultValue - Value to return if no value is found for the key in the Hashtable.
defaultValue if no value is available.ObjectPathHashtable.getInteger(String,int)
public int getIntegerAt(String key,
int index)
ObjectPathHashtableint value that corresponds to a given key. If there
is no value at the key specified, the default value is returned.
getIntegerAt in interface ObjectPathHashtablekey - Path to an element in the document.index - Zero-based index into an array. A value of 0 should be used if not querying an array.
0 if no value is available.ObjectPathHashtable.getIntegerAt(String,int)public int getInteger(String key)
ObjectPathHashtableint value that corresponds to a given key. If there
is no value at the key specified, the default value is returned.
getInteger in interface ObjectPathHashtablekey - Path to an element in the document.
0 if no value is available.ObjectPathHashtable.getInteger(String)public int[] getIntegerArray(String key)
ObjectPathHashtableint values associated with the key specified.
getIntegerArray will do the following if it encounters something other
than an int array for the key specified:
Vector: will be converted to an int array.
int: will return an array with a single entry.
String object: a single element array with the output
of Integer.parseInt; the output of the object's
toString method is passed to parseInt.
If the key is not found, then null is returned.
getIntegerArray in interface ObjectPathHashtablekey - Path to an element in the document.
int values corresponding to this key, or null if no value is available.ObjectPathHashtable.getIntegerArray(String)
public double getDoubleAt(String key,
int index,
double defaultValue)
ObjectPathHashtabledouble value that corresponds to a given key. If there
is no value at the key specified, the default value is returned.
getDoubleAt in interface ObjectPathHashtablekey - Path to an element in the document.index - Zero-based index into an array. A value of 0 should be used if not querying an array.defaultValue - Value to return if no value is found for the key in the Hashtable.
defaultValue if no value is available.ObjectPathHashtable.getDoubleAt(String,int,double)
public double getDouble(String key,
double defaultValue)
ObjectPathHashtabledouble value that corresponds to a given key. If there
is no value at the key specified, the default value is returned.
getDouble in interface ObjectPathHashtablekey - Path to an element in the document.defaultValue - Value to return if no value is found for the key in the Hashtable.
defaultValue if no value is available.ObjectPathHashtable.getDoubleAt(String,int)
public double getDoubleAt(String key,
int index)
ObjectPathHashtabledouble value that corresponds to a given key. If there
is no value at the key specified, the default value is returned.
getDoubleAt in interface ObjectPathHashtablekey - Path to an element in the document.index - Zero-based index into an array. A value of 0 should be used if not querying an array.
ObjectPathHashtable.getDoubleAt(String,int)public double getDouble(String key)
ObjectPathHashtabledouble value that corresponds to a given key. If there
is no value at the key specified, the default value is returned.
getDouble in interface ObjectPathHashtablekey - Path to an element in the document.
ObjectPathHashtable.getDouble(String)public double[] getDoubleArray(String key)
ObjectPathHashtabledouble values associated with the key specified.
getIntegerArray will do the following if it encounters something other
than a double array for the key specified:
Vector: will be converted to a double array.
double: will return an array with a single entry.
String object: a single element array with the output
of Double.parseDouble; the output of the object's
toString method is passed to parseDouble.
If the key is not found, then null is returned.
getDoubleArray in interface ObjectPathHashtablekey - Path to an element in the document.
double values corresponding to this key, or null if no value is available.ObjectPathHashtable.getDoubleArray(String)
public float getFloatAt(String key,
int index,
float defaultValue)
ObjectPathHashtablefloat value that corresponds to a given key. If there
is no value at the key specified, the default value is returned.
getFloatAt in interface ObjectPathHashtablekey - Path to an element in the document.index - Zero-based index into an array. A value of 0 should be used if not querying an array.defaultValue - Value to return if no value is found for the key in the Hashtable.
defaultValue if no value is available.ObjectPathHashtable.getFloatAt(String, int, float)
public float getFloat(String key,
float defaultValue)
ObjectPathHashtablefloat value that corresponds to a given key. If there
is no value at the key specified, the default value is returned.
getFloat in interface ObjectPathHashtablekey - Path to an element in the document.defaultValue - Value to return if no value is found for the key in the Hashtable.
defaultValue if no value is available.ObjectPathHashtable.getFloatAt(String, int)
public float getFloatAt(String key,
int index)
ObjectPathHashtablefloat value that corresponds to a given key. If there
is no value at the key specified, the default value is returned.
getFloatAt in interface ObjectPathHashtablekey - Path to an element in the document.index - Zero-based index into an array. A value of 0 should be used if not querying an array.
ObjectPathHashtable.getFloatAt(String, int)public float getFloat(String key)
ObjectPathHashtablefloat value that corresponds to a given key. If there
is no value at the key specified, the default value is returned.
getFloat in interface ObjectPathHashtablekey - Path to an element in the document.
ObjectPathHashtable.getFloat(String)public float[] getFloatArray(String key)
ObjectPathHashtablefloat values associated with the key specified.
getIntegerArray will do the following if it encounters something other
than a float array for the key specified:
Vector: will be converted to a float array.
float: will return an array with a single entry.
String object: a single element array with the output
of Float.parseFloat; the output of the object's
toString method is passed to parseFloat.
If the key is not found, then null is returned.
getFloatArray in interface ObjectPathHashtablekey - Path to an element in the document.
float values corresponding to this key, or null if no value is available.ObjectPathHashtable.getFloatArray(String)
public short getShortAt(String key,
int index,
short defaultValue)
ObjectPathHashtableshort value that corresponds to a given key. If there
is no value at the key specified, the default value is returned.
getShortAt in interface ObjectPathHashtablekey - Path to an element in the document.index - Zero-based index into an array. A value of 0 should be used if not querying an array.defaultValue - Value to return if no value is found for the key in the Hashtable.
defaultValue if no value is available.ObjectPathHashtable.getShortAt(String, int, short)
public short getShort(String key,
short defaultValue)
ObjectPathHashtableshort value that corresponds to a given key. If there
is no value at the key specified, the default value is returned.
getShort in interface ObjectPathHashtablekey - Path to an element in the document.defaultValue - Value to return if no value is found for the key in the Hashtable.
defaultValue if no value is available.ObjectPathHashtable.getShortAt(String, int)
public short getShortAt(String key,
int index)
ObjectPathHashtablefloat value that corresponds to a given key. If there
is no value at the key specified, the default value is returned.
getShortAt in interface ObjectPathHashtablekey - Path to an element in the document.index - Zero-based index into an array. A value of 0 should be used if not querying an array.
ObjectPathHashtable.getShortAt(String, int)public short getShort(String key)
ObjectPathHashtableshort value that corresponds to a given key. If there
is no value at the key specified, the default value is returned.
getShort in interface ObjectPathHashtablekey - Path to an element in the document.
ObjectPathHashtable.getShort(String)public short[] getShortArray(String key)
ObjectPathHashtableshort values associated with the key specified.
getIntegerArray will do the following if it encounters something other
than a short array for the key specified:
Vector: will be converted to a short array.
short: will return an array with a single entry.
String object: a single element array with the output
of Short.parseShort; the output of the object's
toString method is passed to parseShort.
If the key is not found, then null is returned.
getShortArray in interface ObjectPathHashtablekey - Path to an element in the document.
short values corresponding to this key, or null if no value is available.ObjectPathHashtable.getShortArray(String)
public long getLongAt(String key,
int index,
long defaultValue)
ObjectPathHashtablelong value that corresponds to a given key. If there
is no value at the key specified, the default value is returned.
getLongAt in interface ObjectPathHashtablekey - Path to an element in the document.index - Zero-based index into an array. A value of 0 should be used if not querying an array.defaultValue - Value to return if no value is found for the key in the Hashtable.
defaultValue if no value is available.ObjectPathHashtable.getLongAt(String, int, long)
public long getLong(String key,
long defaultValue)
ObjectPathHashtablelong value that corresponds to a given key. If there
is no value at the key specified, the default value is returned.
getLong in interface ObjectPathHashtablekey - Path to an element in the document.defaultValue - Value to return if no value is found for the key in the Hashtable.
defaultValue if no value is available.ObjectPathHashtable.getLongAt(String, int)
public long getLongAt(String key,
int index)
ObjectPathHashtablelong value that corresponds to a given key. If there
is no value at the key specified, the default value is returned.
getLongAt in interface ObjectPathHashtablekey - Path to an element in the document.index - Zero-based index into an array. A value of 0 should be used if not querying an array.
ObjectPathHashtable.getLongAt(String, int)public long getLong(String key)
ObjectPathHashtablelong value that corresponds to a given key. If there
is no value at the key specified, the default value is returned.
getLong in interface ObjectPathHashtablekey - Path to an element in the document.
ObjectPathHashtable.getLong(String)public long[] getLongArray(String key)
ObjectPathHashtablelong values associated with the key specified.
getIntegerArray will do the following if it encounters something other
than a long array for the key specified:
Vector: will be converted to a long array.
long: will return an array with a single entry.
String object: a single element array with the output
of Long.parseLong; the output of the object's
toString method is passed to parseLong.
If the key is not found, then null is returned.
getLongArray in interface ObjectPathHashtablekey - Path to an element in the document.
long values corresponding to this key, or null if no value is available.ObjectPathHashtable.getLongArray(String)
public byte getByteAt(String key,
int index,
byte defaultValue)
ObjectPathHashtablebyte value that corresponds to a given key. If there
is no value at the key specified, the default value is returned.
getByteAt in interface ObjectPathHashtablekey - Path to an element in the document.index - Zero-based index into an array. A value of 0 should be used if not querying an array.defaultValue - Value to return if no value is found for the key in the Hashtable.
defaultValue if no value is available.ObjectPathHashtable.getByteAt(String, int, byte)
public byte getByte(String key,
byte defaultValue)
ObjectPathHashtablebyte value that corresponds to a given key. If there
is no value at the key specified, the default value is returned.
getByte in interface ObjectPathHashtablekey - Path to an element in the document.defaultValue - Value to return if no value is found for the key in the Hashtable.
defaultValue if no value is available.ObjectPathHashtable.getByteAt(String, int)
public byte getByteAt(String key,
int index)
ObjectPathHashtablebyte value that corresponds to a given key. If there
is no value at the key specified, the default value is returned.
getByteAt in interface ObjectPathHashtablekey - Path to an element in the document.index - Zero-based index into an array. A value of 0 should be used if not querying an array.
ObjectPathHashtable.getByteAt(String, int)public byte getByte(String key)
ObjectPathHashtablebyte value that corresponds to a given key. If there
is no value at the key specified, the default value is returned.
getByte in interface ObjectPathHashtablekey - Path to an element in the document.
ObjectPathHashtable.getByte(String)public byte[] getByteArray(String key)
ObjectPathHashtablebyte values associated with the key specified.
getIntegerArray will do the following if it encounters something other
than a byte array for the key specified:
Vector: will be converted to a byte array.
byte: will return an array with a single entry.
String object: a single element array with the output
of Byte.parseByte; the output of the object's
toString method is passed to parseByte.
If the key is not found, then null is returned.
getByteArray in interface ObjectPathHashtablekey - Path to an element in the document.
byte values corresponding to this key, or null if no value is available.ObjectPathHashtable.getByteArray(String)
public void addString(String key,
String value)
String value at the key specified. If the exisitng
value for the key is null, the new value is set. If the existing
value is a String, then an array is created with both the
existing and new values in it, in that order. If the existing value is
an array, then a new array is created.
key - Location to add value.value - Value to add.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.