Class COM.odi.util.OSDictionary

java.lang.Object
   |
   +----COM.odi.Persistent
           |
           +----COM.odi.util.HashPersistent
                   |
                   +----COM.odi.util.OSDictionary

public class OSDictionary
extends HashPersistent
implements Serializable
OSDictionary is an abstract base class that specifies the protocol for persistent association mechanisms. The interface is similar to java.util.Dictionary for ease of code conversion.

See Also:
Persistent, Dictionary

Constructor Index

 o OSDictionary()
Constructs a new dictionary.
 o OSDictionary(ClassInfo)
Constructs a new hollow dictionary.

Method Index

 o clear()
Removes all entries from the dictionary.
 o clearContents()
Resets the values of the fields of an active persistent object to the default initial values of that class of object.
 o contains(Object)
Checks whether or not the dictionary contains the specified value as an element.
 o containsKey(Object)
Checks whether or not the dictionary contains an element with the specified key.
 o elements()
Returns an enumeration of the elements in the dictionary.
 o flushContents(GenericObject)
Stores the values of the fields of an active persistent object in an instance of GenericObject.
 o get(Object)
Obtains the element mapped at the specified key.
 o getKey(Object)
Returns the actual key stored for the given key.
 o initializeContents(GenericObject)
Initializes the values of the fields of a hollow persistent object from data contained in an instance of GenericObject.
 o isEmpty()
Returns true if the number of keys in the dictionary is zero.
 o keys()
Returns an enumeration of the keys in the dictionary.
 o put(Object, Object)
Enters the mapping of key to value in the dictionary.
 o remove(Object)
Removes any existing mapping at the specified key.
 o size()
Returns the number of keys in the dictionary.

Constructors

 o OSDictionary
  protected OSDictionary(ClassInfo ignored)
Constructs a new hollow dictionary. This constructor should be used only for that purpose

 o OSDictionary
  protected OSDictionary()
Constructs a new dictionary.

Methods

 o initializeContents
  public void initializeContents(GenericObject genObject)
Initializes the values of the fields of a hollow persistent object from data contained in an instance of GenericObject. PSE/PSE Pro arranges to call this method when an application calls fetch() or dirty() on a persistent object. In the class you define, the method that overrides this method must initialize all fields in the hollow persistent object, including any fields defined by superclasses. Initialize superclass fields by invoking initializeContents() on the superclass. This is similar to calls to superclass constructors, although in this case the superclass initialization is not enforced by the compiler.

Parameters:
genObject - The representation of the persistent object that the method should read the field values from.

Overrides:
initializeContents in class HashPersistent
See Also:
initializeContents
 o flushContents
  public void flushContents(GenericObject genObject)
Stores the values of the fields of an active persistent object in an instance of GenericObject. PSE/PSE Pro arranges to call this method when a modified persistent object is evicted and when a transaction is committed. Your persistent class definition must define a method to override this one. Ensure that it writes all fields, even fields that were not modified.

Parameters:
genObject - The representation of the persistent object that this method should write the field values into.

Overrides:
flushContents in class HashPersistent
See Also:
flushContents
 o clearContents
  public void clearContents()
Resets the values of the fields of an active persistent object to the default initial values of that class of object. This causes the object to become a stale persistent object. As with initializeContents(), this method must invoke clearContents() on its superclass to ensure that all fields are correctly cleared.

Overrides:
clearContents in class HashPersistent
See Also:
clearContents
 o size
  public abstract int size()
Returns the number of keys in the dictionary.

 o isEmpty
  public abstract boolean isEmpty()
Returns true if the number of keys in the dictionary is zero.

 o keys
  public abstract Enumeration keys()
Returns an enumeration of the keys in the dictionary. Note that the enumeration is only guaranteed to be valid for the duration of the current transaction.

 o elements
  public abstract Enumeration elements()
Returns an enumeration of the elements in the dictionary. Note that the elements are not necessarily unique and that the enumeration is only guaranteed to be valid for the duration of the current transaction.

 o contains
  public abstract boolean contains(Object value)
Checks whether or not the dictionary contains the specified value as an element.

Parameters:
value - The element to search for, which must be nonnull.

Returns:
The true constant if the dictionary contains the specified value. The false constant if it does not.

Throws: NullPointerException
If value is null.
 o containsKey
  public abstract boolean containsKey(Object key)
Checks whether or not the dictionary contains an element with the specified key.

Parameters:
key - The key to search for.

Returns:
The true constant if the dictionary contains an element with the specified key. The false constant if the dictionary does not.

Throws: NullPointerException
If key is null.
 o get
  public abstract Object get(Object key)
Obtains the element mapped at the specified key.

Parameters:
key - The key for the element you want to obtain.

Returns:
The element at the key or null if no such key exists.

Throws: NullPointerException
If key is null.
 o getKey
  public abstract Object getKey(Object key)
Returns the actual key stored for the given key.

Parameters:
key - The key to search for.

Returns:
The actual key stored for the given key, or null if no such key exists.

Throws: NullPointerException
If key is null.
 o put
  public abstract Object put(Object key,
                             Object value)
Enters the mapping of key to value in the dictionary.

Parameters:
key - The key part of the mapping.

value - The value part of the mapping.

Returns:
The object previously mapped at key, or null.

Throws: NullPointerException
If either key or value is null.
 o remove
  public abstract Object remove(Object key)
Removes any existing mapping at the specified key.

Parameters:
key - The key for the mapping you want to remove.

Returns:
The object previously mapped at the specified key, or null.

Throws: NullPointerException
If key is null.
 o clear
  public abstract void clear()
Removes all entries from the dictionary.


Copyright © 1996, 1997 Object Design, Inc. All rights reserved.