Overview | Package | Class | Use | Tree | Serialized | Deprecated | Index | Help
| ABLE 2.3.0 07/13/2005 14:21:00
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.ibm.able
Class AbleProperties

    java.lang.Object
      java.util.Dictionary
          java.util.Hashtable
              com.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.

Overview | Package | Class | Use | Tree | Serialized | Deprecated | Index | Help
| ABLE 2.3.0 07/13/2005 14:21:00
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

(C) Copyright IBM Corporation 1999, 2005