A mutable second-class HashSet object.
SCO fields declared as type java.util.Collection, java.util.Set, or
java.util.HashSet are populated with objects of this type whenever the owning
object is actively being managed by a state manager.
While an SCO HashSet is owned it is considered either transient or
persistent according to whether its owner is in a transient or
persistent state.
While the owner/set is transient:
-
Elements are restricted to be of the designated element type.
-
All write operations cause the corresponding field in the owner to be
marked dirty.
In addition to the above, while the owner/set is persistent:
-
The contents of the set may or may not be fully loaded in memory.
If they are loaded within a transaction they are considered "up-to-date"
only until the next update of the data store.
-
Some read operations (size(), isEmpty(), contains()) "pass through"
directly to the database if the memory contents are not up-to-date.
This avoids an expensive load from the data store for operations that
don't necessarily involve the entire set.
All other read operations by nature must access the entire set and so
they always load the contents, or reload them if they are not up-to-date.
-
All write operations always pass through directly to the database,
although the memory copy is also updated.
With the exception of retainAll(), no write operation requires the contents
to be loaded.
An instance of this class is always associated with a backing store, although
the store is only used when the set is persistent.
The set disconnects from its owner when
HashSet.unsetOwner is called.
This occurs automatically in a variety of scenarios, such as when the object
is cloned or when its owning object (the one whose Set field refers to it)
transitions to a unmanaged state.
When a disconnect occurs the object subsequently behaves as a normal HashSet.
Subsequent changes affect only the memory contents.
Once disconnected from its owner an instance can never be reconnected.
author: Mike Martin version: $Revision: 1.6 $ |