|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.util.AbstractMap
java.util.HashMap
com.triactive.jdo.sco.HashMap
A mutable second-class HashMap object.
SCO fields declared as type java.util.Map or java.util.HashMap are populated with objects of this type whenever the owning object is actively being managed by a state manager.
While an SCO HashMap is owned it is considered either transient or persistent according to whether its owner is in a transient or persistent state.
While the owner/map is transient:
In addition to the above, while the owner/map is persistent:
An instance of this class is always associated with a backing store, although the store is only used when the map is persistent.
The map disconnects from its owner when 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 Map field refers to it)
transitions to a unmanaged state.
When a disconnect occurs the object subsequently behaves as a normal HashMap.
Subsequent changes affect only the memory contents.
Once disconnected from its owner an instance can never be reconnected.
| Constructor Summary | |
HashMap(java.lang.Object owner,
java.lang.String fieldName,
PersistentMap backing)
Constructs an SCO HashMap representing an existing persistent map. |
|
HashMap(java.lang.Object owner,
java.lang.String fieldName,
PersistentMap backing,
java.util.Map value)
Constructs an SCO HashMap having the specified initial contents. |
|
| Method Summary | |
boolean |
allowsNullValues()
Indicates whether or not this map allows null values. |
void |
applyUpdates()
Called to indicate that the owning object is being made persistent, or that the persistent state of this field is being updated. |
void |
clear()
|
java.lang.Object |
clone()
Creates and returns a copy of this object. |
boolean |
containsKey(java.lang.Object key)
|
boolean |
containsValue(java.lang.Object value)
|
java.util.Set |
entrySet()
|
boolean |
equals(java.lang.Object o)
|
java.lang.Object |
get(java.lang.Object key)
|
java.lang.String |
getFieldName()
Returns the field name in the owner object. |
java.lang.Class |
getKeyType()
Returns the type of keys in this map. |
java.lang.Object |
getOwner()
Returns the owner object of the SCO instance. |
java.lang.Class |
getValueType()
Returns the type of values in this map. |
int |
hashCode()
|
boolean |
isEmpty()
|
java.util.Set |
keySet()
|
void |
makeDirty()
Marks this object dirty. |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value)
|
void |
putAll(java.util.Map m)
|
java.lang.Object |
remove(java.lang.Object key)
|
int |
size()
|
java.lang.String |
toString()
|
void |
unsetOwner()
Disconnects this object from its owner. |
java.util.Collection |
values()
|
protected java.lang.Object |
writeReplace()
Replaces the object to be serialized with a java.util.HashMap object. |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public HashMap(java.lang.Object owner,
java.lang.String fieldName,
PersistentMap backing)
owner - The object that owns this second-class object.fieldName - The fieldName in the owning object.backing - The backing store for this map.
public HashMap(java.lang.Object owner,
java.lang.String fieldName,
PersistentMap backing,
java.util.Map value)
If the owning object is already persistent it is assumed its field is being assigned an entirely new value. The existing map contents are cleared in the data store and the new contents are added.
owner - The object that owns this second-class object.fieldName - The fieldName in the owning object.backing - The backing store for this map.value - The initial contents of the map.| Method Detail |
public java.lang.Object getOwner()
SCO
getOwner in interface SCOnull if currently unowned.public java.lang.String getFieldName()
SCO
getFieldName in interface SCOnull if currently unowned.public java.lang.Class getKeyType()
SCOMap
getKeyType in interface SCOMappublic java.lang.Class getValueType()
SCOMap
getValueType in interface SCOMappublic boolean allowsNullValues()
SCOMap
allowsNullValues in interface SCOMaptrue if null values are allowed,
false otherwise.public void makeDirty()
SCO
makeDirty in interface SCOpublic void applyUpdates()
SCO
applyUpdates in interface SCOpublic void unsetOwner()
SCO
unsetOwner in interface SCOpublic java.lang.Object clone()
Mutable second-class Objects are required to provide a public clone method in order to allow for copying PersistenceCapable objects. In contrast to Object.clone(), this method must not throw a CloneNotSupportedException.
clone in interface SCOpublic int size()
size in interface java.util.Mappublic boolean isEmpty()
isEmpty in interface java.util.Mappublic boolean containsKey(java.lang.Object key)
containsKey in interface java.util.Mappublic boolean containsValue(java.lang.Object value)
containsValue in interface java.util.Mappublic java.lang.Object get(java.lang.Object key)
get in interface java.util.Map
public java.lang.Object put(java.lang.Object key,
java.lang.Object value)
put in interface java.util.Mappublic void putAll(java.util.Map m)
putAll in interface java.util.Mappublic java.lang.Object remove(java.lang.Object key)
remove in interface java.util.Mappublic void clear()
clear in interface java.util.Mappublic java.util.Set keySet()
keySet in interface java.util.Mappublic java.util.Collection values()
values in interface java.util.Mappublic java.util.Set entrySet()
entrySet in interface java.util.Mappublic boolean equals(java.lang.Object o)
equals in interface java.util.Mappublic int hashCode()
hashCode in interface java.util.Mappublic java.lang.String toString()
protected java.lang.Object writeReplace()
HashMap to be serialized instead of this object.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||