Class COM.odi.util.OSDictionary
java.lang.Object
|
+----COM.odi.util.OSDictionary
- public class OSDictionary
- extends Object
- implements IPersistent, Serializable
OSDictionary is an abstract superclass that specifies the protocol
for persistent association mechanisms. The interface is similar to
java.util.Dictionary for ease of code conversion.
- See Also:
- IPersistent, 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.
-
clearDestroyed()
- Removes from the hash table all entries which reference destroyed objects
either as a key or value.
-
clone()
- Clones the 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.
-
hashCode()
- Returns the hash code for the object.
-
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.
ObjectStore arranges to call this
method when an application calls fetch() or dirty() on a
persistent object. If you define a subclass of this class, you must
define a method that overrides this method and initializes 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.
- 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. ObjectStore arranges to call this
method when a modified persistent object is evicted and when a transaction
is committed.
If you define a subclass of this class, you must define a method
that overrides this method and stores 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.
- 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.
If you define a subclass of this class, you must define a method
that overrides this method and that invokes
clearContents() on its superclass to ensure that all fields are correctly
cleared.
- See Also:
- clearContents
hashCode
public int hashCode()
- Returns the hash code for the object.
- Overrides:
- hashCode in class Object
clone
public synchronized Object clone() throws CloneNotSupportedException
- Clones the object.
- Returns:
- The cloned object.
- Throws: CloneNotSupportedException
- If the subclass of
OSDictionary does not implement the Cloneable interface.
- Overrides:
- clone in class Object
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 IndexIterator 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 IndexIterator 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.
clearDestroyed
public abstract void clearDestroyed()
- Removes from the hash table all entries which reference destroyed objects
either as a key or value.
Copyright © 1996, 1997, 1998 Object Design, Inc. All rights reserved.