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
-
OSDictionary()
- Constructs a new dictionary.
-
OSDictionary(ClassInfo)
- Constructs a new hollow dictionary.
-
clear()
- Removes all entries from the dictionary.
-
clearContents()
- Resets the values of the fields of an active persistent object to the default
initial values of that class of object.
-
contains(Object)
- Checks whether or not the dictionary contains the specified value as an element.
-
containsKey(Object)
- Checks whether or not the dictionary contains an element with the specified key.
-
elements()
- Returns an enumeration of the elements in the dictionary.
-
flushContents(GenericObject)
- Stores the values of the fields of an active persistent object in
an instance of GenericObject.
-
get(Object)
- Obtains the element mapped at the specified key.
-
getKey(Object)
- Returns the actual key stored for the given key.
-
initializeContents(GenericObject)
- Initializes the values of the fields of a hollow persistent object from
data contained in an instance of GenericObject.
-
isEmpty()
- Returns true if the number of keys in the dictionary is zero.
-
keys()
- Returns an enumeration of the keys in the dictionary.
-
put(Object, Object)
- Enters the mapping of key to value in the dictionary.
-
remove(Object)
- Removes any existing mapping at the specified key.
-
size()
- Returns the number of keys in the dictionary.
OSDictionary
protected OSDictionary(ClassInfo ignored)
- Constructs a new hollow dictionary.
This constructor should be used only for that purpose
OSDictionary
protected OSDictionary()
- Constructs a new dictionary.
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
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
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
size
public abstract int size()
- Returns the number of keys in the dictionary.
isEmpty
public abstract boolean isEmpty()
- Returns true if the number of keys in the dictionary is zero.
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.
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.
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.
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.
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.
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.
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.
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.
clear
public abstract void clear()
- Removes all entries from the dictionary.
Copyright © 1996, 1997 Object Design, Inc. All rights reserved.