Class COM.odi.util.HashPersistent
java.lang.Object
|
+----COM.odi.Persistent
|
+----COM.odi.util.HashPersistent
- public class HashPersistent
- extends Persistent
- implements Serializable
Note: HashPersistent is deprecated.
When you run the Class File Postprocessor the
postprocessor causes your classes or their superclasses to inherit from
COM.odi.Persistent or COM.odi.util.HashPersistent. The postprocessor
chooses the superclass by examining the class being updated and any subclasses.
If any of these classes are nonabstract and inherit the hashCode() method
from java.lang.Object, then the postprocessor makes the
COM.odi.util.HashPersistent
class the superclass. Otherwise, COM.odi.Persistent becomes the superclass.
In rare situations, you might choose to explicitly define a class to
inherit from HashPersistent in your source code.
All persistence-capable classes that might be used as keys in persistent
hash tables should implement a refinement of hashCode() that produces
the same result for the lifetime of the object.
A class that inherits from this class automatically includes
an identity-based
hashCode() method suitable for allowing objects to serve as
keys in persistent hash tables.
This class defines one persistent field.
- See Also:
- IPersistent
-
HashPersistent()
- Use this constructor when you initially construct an
object.
-
HashPersistent(ClassInfo)
- Use this constructor when you create a hollow object.
-
HashPersistent(int)
- You can use this constructor when you create a hollow object.
-
clearContents()
- Resets the values of the fields of a persistent object to their default
initial values.
-
clone()
- Clones the object.
-
flushContents(GenericObject)
- Stores the values of the fields of a persistent object into
an instance of the GenericObject class.
-
hashCode()
- Returns the hash code for the object.
-
initializeContents(GenericObject)
- Initializes the values of the fields of a persistent object from
data contained in a GenericObject instance.
HashPersistent
public HashPersistent()
- Use this constructor when you initially construct an
object.
HashPersistent
protected HashPersistent(ClassInfo ignored)
- Use this constructor when you create a hollow object.
It is not crucial that you use this overload, but failure to do
so causes extra processing.
- Parameters:
- ignored - Only used to distinguish this overloading. The value is
not used.
HashPersistent
protected HashPersistent(int ignored)
- You can use this constructor when you create a hollow object.
However, Object Design recommends that you use the hollow object constructor
that accepts a ClassInfo argument.
This constructor is deprecated in this release. It will be
removed in a future release.
- Parameters:
- ignored - Only used to distinguish this overloading. The value is
not used.
initializeContents
public void initializeContents(GenericObject genObj)
- Initializes the values of the fields of a persistent object from
data contained in a GenericObject instance. Subclasses must
define this function
and delegate to this function from within their implementation.
This method causes a hollow persistent object to become an active
persistent object.
- Parameters:
- genObj - An instance of the GenericObject class.
- Overrides:
- initializeContents in class Persistent
- See Also:
- initializeContents
clearContents
public void clearContents()
- Resets the values of the fields of a persistent object to their default
initial values. As with initializeContents(), the method must invoke
clearContents() on its superclass to ensure that all fields are correctly
cleared. This method causes an active persistent object to become
a hollow persistent object.
- Overrides:
- clearContents in class Persistent
- See Also:
- clearContents
flushContents
public void flushContents(GenericObject genObj)
- Stores the values of the fields of a persistent object into
an instance of the GenericObject class. ObjectStore arranges to call this
method when a modified (the Persistent.dirty() method was called on
the object) persistent object is evicted. Overriding methods
should write all fields, even fields that were not modified.
Also, an overriding method should invoke flushContents() on its superclass.
- Parameters:
- genObj - An instance of the GenericObject class.
- Overrides:
- flushContents in class Persistent
- See Also:
- flushContents
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
HashPersistent does not implement the Cloneable interface.
- Overrides:
- clone in class Persistent
Copyright © 1996, 1997, 1998 Object Design, Inc. All rights reserved.