com.ibm.wbi.persistent
Class SectionDictionary

java.lang.Object
  |
  +--java.util.Dictionary
        |
        +--com.ibm.wbi.persistent.SectionDictionary

public class SectionDictionary
extends java.util.Dictionary

Wrapper to use a Section where a Dictionary is needed. Keys must be strings and values must be serializeable otherwise you'll get runtime exceptions.


Constructor Summary
SectionDictionary(Section section)
          Creates a new SectionDictionary instance.
 
Method Summary
 java.util.Enumeration elements()
          Return an enumeration of values from the underlying Section
 java.lang.Object get(java.lang.Object key)
          Get the named key from the underlying Section.
 boolean isEmpty()
          Whether there are any keys in the underlying Section.
 java.util.Enumeration keys()
          Return an enumeration of keys from the underlying Section
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Add a new key/value binding.
 java.lang.Object remove(java.lang.Object key)
          Remove the named binding.
 int size()
          Returns the number of keys in the underlying section
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SectionDictionary

public SectionDictionary(Section section)
Creates a new SectionDictionary instance.
Parameters:
section - The wrapped Section value
Method Detail

size

public int size()
Returns the number of keys in the underlying section
Overrides:
size in class java.util.Dictionary
Returns:
The number of keys in the underlying Section

isEmpty

public boolean isEmpty()
Whether there are any keys in the underlying Section.
Overrides:
isEmpty in class java.util.Dictionary
Returns:
a boolean value

keys

public java.util.Enumeration keys()
Return an enumeration of keys from the underlying Section
Overrides:
keys in class java.util.Dictionary
Returns:
an Enumeration value

elements

public java.util.Enumeration elements()
Return an enumeration of values from the underlying Section
Overrides:
elements in class java.util.Dictionary
Returns:
an Enumeration value

get

public java.lang.Object get(java.lang.Object key)
Get the named key from the underlying Section. Despite the signature of this method, the key must be a String and the value will be Serializable.
Overrides:
get in class java.util.Dictionary
Parameters:
key - The key of the value to retrieve (use String only)
Returns:
The value (returns Serializable)

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Add a new key/value binding. Despite the signature of this method, the key must be a String and the value must be Serializable.
Overrides:
put in class java.util.Dictionary
Parameters:
key - The key to bind a value to (use String)
value - The value (use Serializable)
Returns:
The old value, or null

remove

public java.lang.Object remove(java.lang.Object key)
Remove the named binding. Despite the signature of this method, the key must be a String.
Overrides:
remove in class java.util.Dictionary
Parameters:
key - The key for the binding to remove
Returns:
The old value, or null