net.rim.device.api.io.parser
Class ObjectPathHashtableBase

java.lang.Object
  extended by java.util.Hashtable
      extended by net.rim.device.api.io.parser.ObjectPathHashtableBase
All Implemented Interfaces:
ObjectPathHashtable, Persistable
Direct Known Subclasses:
JSONHashtable, XMLHashtable

public abstract class ObjectPathHashtableBase
extends Hashtable
implements Persistable, ObjectPathHashtable

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.

Since:
BlackBerry API 6.0.0

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

getNumKeys

public int getNumKeys(String key)
Returns the number of times a key occurs in a document. Note that if the key refers to an element in an array, the size of the array is returned if explicit paths are enabled; otherwise, a value of 1 is returned.

Specified by:
getNumKeys in interface ObjectPathHashtable
Parameters:
key - Path to an element in a document.
Returns:
Number of occurrences of this path in the document that was parsed.
Since:
BlackBerry API 6.0.0

getNumValues

public int getNumValues(String key)
Returns the number of values in the document that correspond to the path specified.

Specified by:
getNumValues in interface ObjectPathHashtable
Parameters:
key - Path to element in document
Returns:
Number of values available under this key.
Since:
BlackBerry API 6.0.0

getStringAt

public String getStringAt(String key,
                          int index,
                          String defaultValue)
Description copied from interface: ObjectPathHashtable
Returns the String 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.

Specified by:
getStringAt in interface ObjectPathHashtable
Parameters:
key - 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.
Returns:
The value corresponding to this key, or defaultValue if no value is available.
See Also:
ObjectPathHashtable.getStringAt(String, int, String)
Since:
BlackBerry API 6.0.0

getString

public String getString(String key,
                        String defaultValue)
Description copied from interface: ObjectPathHashtable
Returns the String 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.

Specified by:
getString in interface ObjectPathHashtable
Parameters:
key - Path to an element in document.
defaultValue - Value to return if no value is found for the key in the Hashtable.
Returns:
The value corresponding to this key, or defaultValue if no value is available.
See Also:
ObjectPathHashtable.getString(String, String)
Since:
BlackBerry API 6.0.0

getStringAt

public String getStringAt(String key,
                          int index)
Description copied from interface: ObjectPathHashtable
Returns the String 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.

Specified by:
getStringAt in interface ObjectPathHashtable
Parameters:
key - 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.
Returns:
The value corresponding to this key, or null if no value is available.
See Also:
ObjectPathHashtable.getStringAt(String, int)
Since:
BlackBerry API 6.0.0

getString

public String getString(String key)
Description copied from interface: ObjectPathHashtable
Returns the String 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.

Specified by:
getString in interface ObjectPathHashtable
Parameters:
key - Path to an element in document.
Returns:
The value corresponding to this key, or null if no value is available.
See Also:
ObjectPathHashtable.getString(String)
Since:
BlackBerry API 6.0.0

getStringArray

public String[] getStringArray(String key)
Description copied from interface: ObjectPathHashtable
Returns an array of String values associated with the key specified. getStringArray will do the following if it encounters something other than a String array for the key specified:

If the key is not found, then null is returned.

Specified by:
getStringArray in interface ObjectPathHashtable
Parameters:
key - Path to an element in the document.
Returns:
An array of String values corresponding to this key, or null if no value is available.
See Also:
ObjectPathHashtable.getStringArray(String)
Since:
BlackBerry API 6.0.0

getBooleanAt

public boolean getBooleanAt(String key,
                            int index,
                            boolean defaultValue)
Description copied from interface: ObjectPathHashtable
Indicates whether the value associated with a key is equal to the string "true". The value is trimmed and a case-insensitive comparison is performed. If the key is not present, or index exceeds the number of strings associated with the key, then the default value is returned.

Specified by:
getBooleanAt in interface ObjectPathHashtable
Parameters:
key - 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.
Returns:
The value corresponding to this key, or defaultValue if no value is available.
See Also:
ObjectPathHashtable.getBooleanAt(String, int, boolean)
Since:
BlackBerry API 6.0.0

getBoolean

public boolean getBoolean(String key,
                          boolean defaultValue)
Description copied from interface: ObjectPathHashtable
Indicates whether the value associated with a key is equal to the string "true". The value is trimmed and a case-insensitive comparison is performed. If the key is not present, or index exceeds the number of strings associated with the key, then the default value is returned.

Specified by:
getBoolean in interface ObjectPathHashtable
Parameters:
key - Path to an element in the document.
defaultValue - Value to return if no value is found for the key in the Hashtable.
Returns:
The value corresponding to this key, or defaultValue if no value is available.
See Also:
ObjectPathHashtable.getBoolean(String,boolean)
Since:
BlackBerry API 6.0.0

getBooleanAt

public boolean getBooleanAt(String key,
                            int index)
Description copied from interface: ObjectPathHashtable
Indicates whether the value associated with a key is equal to the string "true". The value is trimmed and a case-insensitive comparison is performed. If the key is not present, or index exceeds the number of strings associated with the key, then false is returned.

Specified by:
getBooleanAt in interface ObjectPathHashtable
Parameters:
key - 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.
Returns:
The value corresponding to this key, or false if no value is available.
See Also:
ObjectPathHashtable.getBooleanAt(String,int)
Since:
BlackBerry API 6.0.0

getBoolean

public boolean getBoolean(String key)
Description copied from interface: ObjectPathHashtable
Indicates whether the value associated with a key is equal to the string "true". The value is trimmed and a case-insensitive comparison is performed. If the key is not present, or index exceeds the number of strings associated with the key, then false is returned.

Specified by:
getBoolean in interface ObjectPathHashtable
Parameters:
key - Path to an element in the document.
Returns:
The value corresponding to this key, or false if no value is available.
See Also:
ObjectPathHashtable.getBoolean(String)
Since:
BlackBerry API 6.0.0

getBooleanArray

public boolean[] getBooleanArray(String key)
Description copied from interface: ObjectPathHashtable
Returns an array of boolean values associated with the key specified. getBooleanArray will do the following if it encounters something other than a boolean array for the key specified:

If the key is not found, then null is returned.

Specified by:
getBooleanArray in interface ObjectPathHashtable
Parameters:
key - Path to an element in the document.
Returns:
An array of boolean values corresponding to this key, or null if no value is available.
See Also:
ObjectPathHashtable.getBooleanArray(String)
Since:
BlackBerry API 6.0.0

getIntegerAt

public int getIntegerAt(String key,
                        int index,
                        int defaultValue,
                        int radix)
Description copied from interface: ObjectPathHashtable
Returns an int value that corresponds to a given key. If there is no value at the key specified, the default value is returned.

Specified by:
getIntegerAt in interface ObjectPathHashtable
Parameters:
key - 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.
Returns:
The value corresponding to the key, or defaultValue if no value is available.
See Also:
ObjectPathHashtable.getIntegerAt(String,int,int,int)
Since:
BlackBerry API 6.0.0

getIntegerAt

public int getIntegerAt(String key,
                        int index,
                        int defaultValue)
Description copied from interface: ObjectPathHashtable
Returns an int value that corresponds to a given key. If there is no value at the key specified, the default value is returned.

Specified by:
getIntegerAt in interface ObjectPathHashtable
Parameters:
key - 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.
Returns:
The value corresponding to the key, or defaultValue if no value is available.
See Also:
ObjectPathHashtable.getIntegerAt(String,int,int)
Since:
BlackBerry API 6.0.0

getInteger

public int getInteger(String key,
                      int defaultValue,
                      int radix)
Description copied from interface: ObjectPathHashtable
Returns an int value that corresponds to a given key. If there is no value at the key specified, the default value is returned.

Specified by:
getInteger in interface ObjectPathHashtable
Parameters:
key - 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.
Returns:
The value corresponding to the key, or defaultValue if no value is available.
See Also:
ObjectPathHashtable.getInteger(String,int,int)
Since:
BlackBerry API 6.0.0

getInteger

public int getInteger(String key,
                      int defaultValue)
Description copied from interface: ObjectPathHashtable
Returns an int value that corresponds to a given key. If there is no value at the key specified, the default value is returned.

Specified by:
getInteger in interface ObjectPathHashtable
Parameters:
key - Path to an element in the document.
defaultValue - Value to return if no value is found for the key in the Hashtable.
Returns:
The value corresponding to the key, or defaultValue if no value is available.
See Also:
ObjectPathHashtable.getInteger(String,int)
Since:
BlackBerry API 6.0.0

getIntegerAt

public int getIntegerAt(String key,
                        int index)
Description copied from interface: ObjectPathHashtable
Returns an int value that corresponds to a given key. If there is no value at the key specified, the default value is returned.

Specified by:
getIntegerAt in interface ObjectPathHashtable
Parameters:
key - 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.
Returns:
The value corresponding to the key, or 0 if no value is available.
See Also:
ObjectPathHashtable.getIntegerAt(String,int)
Since:
BlackBerry API 6.0.0

getInteger

public int getInteger(String key)
Description copied from interface: ObjectPathHashtable
Returns an int value that corresponds to a given key. If there is no value at the key specified, the default value is returned.

Specified by:
getInteger in interface ObjectPathHashtable
Parameters:
key - Path to an element in the document.
Returns:
The value corresponding to the key, or 0 if no value is available.
See Also:
ObjectPathHashtable.getInteger(String)
Since:
BlackBerry API 6.0.0

getIntegerArray

public int[] getIntegerArray(String key)
Description copied from interface: ObjectPathHashtable
Returns an array of int values associated with the key specified. getIntegerArray will do the following if it encounters something other than an int array for the key specified:

If the key is not found, then null is returned.

Specified by:
getIntegerArray in interface ObjectPathHashtable
Parameters:
key - Path to an element in the document.
Returns:
An array of int values corresponding to this key, or null if no value is available.
See Also:
ObjectPathHashtable.getIntegerArray(String)
Since:
BlackBerry API 6.0.0

getDoubleAt

public double getDoubleAt(String key,
                          int index,
                          double defaultValue)
Description copied from interface: ObjectPathHashtable
Returns a double value that corresponds to a given key. If there is no value at the key specified, the default value is returned.

Specified by:
getDoubleAt in interface ObjectPathHashtable
Parameters:
key - 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.
Returns:
The value corresponding to the key, or defaultValue if no value is available.
See Also:
ObjectPathHashtable.getDoubleAt(String,int,double)
Since:
BlackBerry API 6.0.0

getDouble

public double getDouble(String key,
                        double defaultValue)
Description copied from interface: ObjectPathHashtable
Returns a double value that corresponds to a given key. If there is no value at the key specified, the default value is returned.

Specified by:
getDouble in interface ObjectPathHashtable
Parameters:
key - Path to an element in the document.
defaultValue - Value to return if no value is found for the key in the Hashtable.
Returns:
The value corresponding to the key, or defaultValue if no value is available.
See Also:
ObjectPathHashtable.getDoubleAt(String,int)
Since:
BlackBerry API 6.0.0

getDoubleAt

public double getDoubleAt(String key,
                          int index)
Description copied from interface: ObjectPathHashtable
Returns a double value that corresponds to a given key. If there is no value at the key specified, the default value is returned.

Specified by:
getDoubleAt in interface ObjectPathHashtable
Parameters:
key - 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.
Returns:
The value corresponding to the key, or 0 if no value is available.
See Also:
ObjectPathHashtable.getDoubleAt(String,int)
Since:
BlackBerry API 6.0.0

getDouble

public double getDouble(String key)
Description copied from interface: ObjectPathHashtable
Returns a double value that corresponds to a given key. If there is no value at the key specified, the default value is returned.

Specified by:
getDouble in interface ObjectPathHashtable
Parameters:
key - Path to an element in the document.
Returns:
The value corresponding to the key, or 0 if no value is available.
See Also:
ObjectPathHashtable.getDouble(String)
Since:
BlackBerry API 6.0.0

getDoubleArray

public double[] getDoubleArray(String key)
Description copied from interface: ObjectPathHashtable
Returns an array of double values associated with the key specified. getIntegerArray will do the following if it encounters something other than a double array for the key specified:

If the key is not found, then null is returned.

Specified by:
getDoubleArray in interface ObjectPathHashtable
Parameters:
key - Path to an element in the document.
Returns:
An array of double values corresponding to this key, or null if no value is available.
See Also:
ObjectPathHashtable.getDoubleArray(String)
Since:
BlackBerry API 6.0.0

getFloatAt

public float getFloatAt(String key,
                        int index,
                        float defaultValue)
Description copied from interface: ObjectPathHashtable
Returns a float value that corresponds to a given key. If there is no value at the key specified, the default value is returned.

Specified by:
getFloatAt in interface ObjectPathHashtable
Parameters:
key - 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.
Returns:
The value corresponding to the key, or defaultValue if no value is available.
See Also:
ObjectPathHashtable.getFloatAt(String, int, float)
Since:
BlackBerry API 6.0.0

getFloat

public float getFloat(String key,
                      float defaultValue)
Description copied from interface: ObjectPathHashtable
Returns an float value that corresponds to a given key. If there is no value at the key specified, the default value is returned.

Specified by:
getFloat in interface ObjectPathHashtable
Parameters:
key - Path to an element in the document.
defaultValue - Value to return if no value is found for the key in the Hashtable.
Returns:
The value corresponding to the key, or defaultValue if no value is available.
See Also:
ObjectPathHashtable.getFloatAt(String, int)
Since:
BlackBerry API 6.0.0

getFloatAt

public float getFloatAt(String key,
                        int index)
Description copied from interface: ObjectPathHashtable
Returns a float value that corresponds to a given key. If there is no value at the key specified, the default value is returned.

Specified by:
getFloatAt in interface ObjectPathHashtable
Parameters:
key - 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.
Returns:
The value corresponding to the key, or 0 if no value is available.
See Also:
ObjectPathHashtable.getFloatAt(String, int)
Since:
BlackBerry API 6.0.0

getFloat

public float getFloat(String key)
Description copied from interface: ObjectPathHashtable
Returns a float value that corresponds to a given key. If there is no value at the key specified, the default value is returned.

Specified by:
getFloat in interface ObjectPathHashtable
Parameters:
key - Path to an element in the document.
Returns:
The value corresponding to the key, or 0 if no value is available.
See Also:
ObjectPathHashtable.getFloat(String)
Since:
BlackBerry API 6.0.0

getFloatArray

public float[] getFloatArray(String key)
Description copied from interface: ObjectPathHashtable
Returns an array of float values associated with the key specified. getIntegerArray will do the following if it encounters something other than a float array for the key specified:

If the key is not found, then null is returned.

Specified by:
getFloatArray in interface ObjectPathHashtable
Parameters:
key - Path to an element in the document.
Returns:
An array of float values corresponding to this key, or null if no value is available.
See Also:
ObjectPathHashtable.getFloatArray(String)
Since:
BlackBerry API 6.0.0

getShortAt

public short getShortAt(String key,
                        int index,
                        short defaultValue)
Description copied from interface: ObjectPathHashtable
Returns a short value that corresponds to a given key. If there is no value at the key specified, the default value is returned.

Specified by:
getShortAt in interface ObjectPathHashtable
Parameters:
key - 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.
Returns:
The value corresponding to the key, or defaultValue if no value is available.
See Also:
ObjectPathHashtable.getShortAt(String, int, short)
Since:
BlackBerry API 6.0.0

getShort

public short getShort(String key,
                      short defaultValue)
Description copied from interface: ObjectPathHashtable
Returns a short value that corresponds to a given key. If there is no value at the key specified, the default value is returned.

Specified by:
getShort in interface ObjectPathHashtable
Parameters:
key - Path to an element in the document.
defaultValue - Value to return if no value is found for the key in the Hashtable.
Returns:
The value corresponding to the key, or defaultValue if no value is available.
See Also:
ObjectPathHashtable.getShortAt(String, int)
Since:
BlackBerry API 6.0.0

getShortAt

public short getShortAt(String key,
                        int index)
Description copied from interface: ObjectPathHashtable
Returns a float value that corresponds to a given key. If there is no value at the key specified, the default value is returned.

Specified by:
getShortAt in interface ObjectPathHashtable
Parameters:
key - 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.
Returns:
The value corresponding to the key, or 0 if no value is available.
See Also:
ObjectPathHashtable.getShortAt(String, int)
Since:
BlackBerry API 6.0.0

getShort

public short getShort(String key)
Description copied from interface: ObjectPathHashtable
Returns a short value that corresponds to a given key. If there is no value at the key specified, the default value is returned.

Specified by:
getShort in interface ObjectPathHashtable
Parameters:
key - Path to an element in the document.
Returns:
The value corresponding to the key, or 0 if no value is available.
See Also:
ObjectPathHashtable.getShort(String)
Since:
BlackBerry API 6.0.0

getShortArray

public short[] getShortArray(String key)
Description copied from interface: ObjectPathHashtable
Returns an array of short values associated with the key specified. getIntegerArray will do the following if it encounters something other than a short array for the key specified:

If the key is not found, then null is returned.

Specified by:
getShortArray in interface ObjectPathHashtable
Parameters:
key - Path to an element in the document.
Returns:
An array of short values corresponding to this key, or null if no value is available.
See Also:
ObjectPathHashtable.getShortArray(String)
Since:
BlackBerry API 6.0.0

getLongAt

public long getLongAt(String key,
                      int index,
                      long defaultValue)
Description copied from interface: ObjectPathHashtable
Returns a long value that corresponds to a given key. If there is no value at the key specified, the default value is returned.

Specified by:
getLongAt in interface ObjectPathHashtable
Parameters:
key - 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.
Returns:
The value corresponding to the key, or defaultValue if no value is available.
See Also:
ObjectPathHashtable.getLongAt(String, int, long)
Since:
BlackBerry API 6.0.0

getLong

public long getLong(String key,
                    long defaultValue)
Description copied from interface: ObjectPathHashtable
Returns a long value that corresponds to a given key. If there is no value at the key specified, the default value is returned.

Specified by:
getLong in interface ObjectPathHashtable
Parameters:
key - Path to an element in the document.
defaultValue - Value to return if no value is found for the key in the Hashtable.
Returns:
The value corresponding to the key, or defaultValue if no value is available.
See Also:
ObjectPathHashtable.getLongAt(String, int)
Since:
BlackBerry API 6.0.0

getLongAt

public long getLongAt(String key,
                      int index)
Description copied from interface: ObjectPathHashtable
Returns a long value that corresponds to a given key. If there is no value at the key specified, the default value is returned.

Specified by:
getLongAt in interface ObjectPathHashtable
Parameters:
key - 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.
Returns:
The value corresponding to the key, or 0 if no value is available.
See Also:
ObjectPathHashtable.getLongAt(String, int)
Since:
BlackBerry API 6.0.0

getLong

public long getLong(String key)
Description copied from interface: ObjectPathHashtable
Returns a long value that corresponds to a given key. If there is no value at the key specified, the default value is returned.

Specified by:
getLong in interface ObjectPathHashtable
Parameters:
key - Path to an element in the document.
Returns:
The value corresponding to the key, or 0 if no value is available.
See Also:
ObjectPathHashtable.getLong(String)
Since:
BlackBerry API 6.0.0

getLongArray

public long[] getLongArray(String key)
Description copied from interface: ObjectPathHashtable
Returns an array of long values associated with the key specified. getIntegerArray will do the following if it encounters something other than a long array for the key specified:

If the key is not found, then null is returned.

Specified by:
getLongArray in interface ObjectPathHashtable
Parameters:
key - Path to an element in the document.
Returns:
An array of long values corresponding to this key, or null if no value is available.
See Also:
ObjectPathHashtable.getLongArray(String)
Since:
BlackBerry API 6.0.0

getByteAt

public byte getByteAt(String key,
                      int index,
                      byte defaultValue)
Description copied from interface: ObjectPathHashtable
Returns a byte value that corresponds to a given key. If there is no value at the key specified, the default value is returned.

Specified by:
getByteAt in interface ObjectPathHashtable
Parameters:
key - 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.
Returns:
The value corresponding to the key, or defaultValue if no value is available.
See Also:
ObjectPathHashtable.getByteAt(String, int, byte)
Since:
BlackBerry API 6.0.0

getByte

public byte getByte(String key,
                    byte defaultValue)
Description copied from interface: ObjectPathHashtable
Returns an byte value that corresponds to a given key. If there is no value at the key specified, the default value is returned.

Specified by:
getByte in interface ObjectPathHashtable
Parameters:
key - Path to an element in the document.
defaultValue - Value to return if no value is found for the key in the Hashtable.
Returns:
The value corresponding to the key, or defaultValue if no value is available.
See Also:
ObjectPathHashtable.getByteAt(String, int)
Since:
BlackBerry API 6.0.0

getByteAt

public byte getByteAt(String key,
                      int index)
Description copied from interface: ObjectPathHashtable
Returns a byte value that corresponds to a given key. If there is no value at the key specified, the default value is returned.

Specified by:
getByteAt in interface ObjectPathHashtable
Parameters:
key - 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.
Returns:
The value corresponding to the key, or 0 if no value is available.
See Also:
ObjectPathHashtable.getByteAt(String, int)
Since:
BlackBerry API 6.0.0

getByte

public byte getByte(String key)
Description copied from interface: ObjectPathHashtable
Returns a byte value that corresponds to a given key. If there is no value at the key specified, the default value is returned.

Specified by:
getByte in interface ObjectPathHashtable
Parameters:
key - Path to an element in the document.
Returns:
The value corresponding to the key, or 0 if no value is available.
See Also:
ObjectPathHashtable.getByte(String)
Since:
BlackBerry API 6.0.0

getByteArray

public byte[] getByteArray(String key)
Description copied from interface: ObjectPathHashtable
Returns an array of byte values associated with the key specified. getIntegerArray will do the following if it encounters something other than a byte array for the key specified:

If the key is not found, then null is returned.

Specified by:
getByteArray in interface ObjectPathHashtable
Parameters:
key - Path to an element in the document.
Returns:
An array of byte values corresponding to this key, or null if no value is available.
See Also:
ObjectPathHashtable.getByteArray(String)
Since:
BlackBerry API 6.0.0

addString

public void addString(String key,
                      String value)
Adds a 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.

Parameters:
key - Location to add value.
value - Value to add.
Since:
BlackBerry API 6.0.0





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.