ABLE 2.3.0 07/13/2005 14:21:00

com.ibm.able
Class AbleProperties

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended bycom.ibm.able.AbleProperties
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class AbleProperties
extends java.util.Hashtable
implements java.io.Serializable

This class is an extension of Hashtable that limits the keys and values to strings. Use setProperty() to add a property instead of put(). Convenience methods are included to provide default values and to convert to int, long, and double.

Since:
2.3.0
See Also:
Serialized Form

Constructor Summary
AbleProperties()
          Default constructor.
AbleProperties(java.util.Map map)
          Constructor an AbleProperties object from an existing map.
 
Method Summary
 java.lang.String getProperty(java.lang.String theName)
          Get a property value.
 double getProperty(java.lang.String theName, double theDefault)
          Return a property's value as a double.
 int getProperty(java.lang.String theName, int theDefault)
          Return a property's value as an int.
 long getProperty(java.lang.String theName, long theDefault)
          Return a property's value as a long.
 java.lang.String getProperty(java.lang.String theName, java.lang.String theDefault)
          Return a property's value as a String.
 java.lang.String removeProperty(java.lang.String theName)
          Remove a property from the map.
 void setProperty(java.lang.String theName, double theValue)
          Set a property value.
 void setProperty(java.lang.String theName, int theValue)
          Set a property value.
 void setProperty(java.lang.String theName, long theValue)
          Set a property value.
 void setProperty(java.lang.String theName, java.lang.String theValue)
          Set a property value.
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AbleProperties

public AbleProperties()
Default constructor.


AbleProperties

public AbleProperties(java.util.Map map)
Constructor an AbleProperties object from an existing map. Note that all keys and objects are assumed to be String objects but no checking is done.

Parameters:
map - A Map with String key and String object values.
Method Detail

setProperty

public void setProperty(java.lang.String theName,
                        java.lang.String theValue)
Set a property value. New properties are added, existing properties are replaced with the new value.

Parameters:
theName - The property name.
theValue - The property value.

getProperty

public java.lang.String getProperty(java.lang.String theName)
Get a property value. New properties are added, existing properties are replaced with the new value.

Parameters:
theName - The property name.
Returns:
The property value.

getProperty

public java.lang.String getProperty(java.lang.String theName,
                                    java.lang.String theDefault)
Return a property's value as a String.

Parameters:
theName - The property name.
theDefault - The property value to return if the property is undefined.
Returns:
The property value.

setProperty

public void setProperty(java.lang.String theName,
                        int theValue)
Set a property value. New properties are added, existing properties are replaced with the new value.

Parameters:
theName - The property name.
theValue - The property value.

getProperty

public int getProperty(java.lang.String theName,
                       int theDefault)
Return a property's value as an int.

Parameters:
theName - The property name.
theDefault - The property value to return if the property is undefined.
Returns:
The property value.

setProperty

public void setProperty(java.lang.String theName,
                        double theValue)
Set a property value. New properties are added, existing properties are replaced with the new value.

Parameters:
theName - The property name.
theValue - The property value.

getProperty

public double getProperty(java.lang.String theName,
                          double theDefault)
Return a property's value as a double.

Parameters:
theName - The property name.
theDefault - The property value to return if the property is undefined.
Returns:
The property value.

setProperty

public void setProperty(java.lang.String theName,
                        long theValue)
Set a property value. New properties are added, existing properties are replaced with the new value.

Parameters:
theName - The property name.
theValue - The property value.

getProperty

public long getProperty(java.lang.String theName,
                        long theDefault)
Return a property's value as a long.

Parameters:
theName - The property name.
theDefault - The property value to return if the property is undefined.
Returns:
The property value.

removeProperty

public java.lang.String removeProperty(java.lang.String theName)
Remove a property from the map.

Parameters:
theName - The property name.
Returns:
The property value.

ABLE 2.3.0 07/13/2005 14:21:00

(C) Copyright IBM Corporation 1999, 2005