SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

com.solarmetric.rd.kodo.util
Class ProxyHashMap

java.lang.Object
  |
  +--java.util.AbstractMap
        |
        +--java.util.HashMap
              |
              +--com.solarmetric.rd.kodo.util.ProxyHashMap
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, Proxy, ProxyMap, java.io.Serializable
Direct Known Subclasses:
ProxyHashMapCT

public class ProxyHashMap
extends java.util.HashMap
implements ProxyMap

Extension of the HashMap type that dirties the persistent/transactional field it is assigned to on modification. The need to dirty the field on any modification mandates that this class must override all mutator methods of the base type. This may lead to multiple calls to the PersistenceCapable.jdoMakeDirty(java.lang.String) for one state change if one mutator method of the base type calls another.

See Also:
Serialized Form

Constructor Summary
ProxyHashMap()
          Template constructor.
ProxyHashMap(java.lang.Class keyType, java.lang.Class valueType)
          Constructor.
ProxyHashMap(java.util.Map m, java.lang.Class keyType, java.lang.Class valueType)
          Constructor.
 
Method Summary
 void clear()
           
 java.util.Set entrySet()
           
 java.util.Collection getAdded()
           
 com.solarmetric.rd.kodo.util.ChangeManager getChangeManager()
           
 java.util.Comparator getComparator()
          Return the comparator used in this map, or null if it is unordered or uses natural ordering.
 java.util.Map getCopy(java.util.Map orig)
          This method should return a copy of the given map; the copy should be of the same class as the superclass of this collection.
 java.lang.Object getOwner()
          Return the owning object.
 java.lang.String getOwnerFieldName()
          Return the owning field name.
 java.util.Collection getRemoved()
           
 boolean isOwner(java.lang.Object pc, java.lang.String fieldName)
          Return true if the given object and field name match the owner of this proxy.
 java.util.Set keySet()
           
 com.solarmetric.rd.kodo.util.ProxyMap newInstance(java.lang.Class keyType, java.lang.Class valueType, java.util.Map contents, java.util.Comparator compare)
          This method should return a new proxy of the same concrete type as the implementing class.
 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)
           
 void setChangeManager(com.solarmetric.rd.kodo.util.ChangeManager cm)
           
 void setOwner(java.lang.Object pc, java.lang.String fieldName)
          Set the owning JDO instance of the proxy and the name of the field it is assigned to.
 java.util.Collection values()
           
protected  java.lang.Object writeReplace()
           
 
Methods inherited from class java.util.HashMap
clone, containsKey, containsValue, get, isEmpty, size
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
containsKey, containsValue, equals, get, hashCode, isEmpty, size
 

Constructor Detail

ProxyHashMap

public ProxyHashMap()
Template constructor.


ProxyHashMap

public ProxyHashMap(java.util.Map m,
                    java.lang.Class keyType,
                    java.lang.Class valueType)
Constructor.

Parameters:
m - The data that this map should contain.
keyType - All keys in this map must be instances of this type.
valueType - All values in this map must be instances of this type.

ProxyHashMap

public ProxyHashMap(java.lang.Class keyType,
                    java.lang.Class valueType)
Constructor.

Parameters:
keyType - All keys in this map must be instances of this type.
valueType - All values in this map must be instances of this type.
Method Detail

newInstance

public com.solarmetric.rd.kodo.util.ProxyMap newInstance(java.lang.Class keyType,
                                                         java.lang.Class valueType,
                                                         java.util.Map contents,
                                                         java.util.Comparator compare)
Description copied from interface: ProxyMap
This method should return a new proxy of the same concrete type as the implementing class. Used by the ProxyManager factories: one template instance of each type is created for the purpose of producing new instances via this method. Overcomes the performance penalties of reflection.

Specified by:
newInstance in interface ProxyMap

getCopy

public java.util.Map getCopy(java.util.Map orig)
Description copied from interface: ProxyMap
This method should return a copy of the given map; the copy should be of the same class as the superclass of this collection.

Specified by:
getCopy in interface ProxyMap

getComparator

public java.util.Comparator getComparator()
Description copied from interface: ProxyMap
Return the comparator used in this map, or null if it is unordered or uses natural ordering.

Specified by:
getComparator in interface ProxyMap

setOwner

public void setOwner(java.lang.Object pc,
                     java.lang.String fieldName)
Description copied from interface: Proxy
Set the owning JDO instance of the proxy and the name of the field it is assigned to. Set to null to indicate that the proxy is no longer managed.

Specified by:
setOwner in interface Proxy

getOwner

public java.lang.Object getOwner()
Description copied from interface: Proxy
Return the owning object.

Specified by:
getOwner in interface Proxy

getOwnerFieldName

public java.lang.String getOwnerFieldName()
Description copied from interface: Proxy
Return the owning field name.

Specified by:
getOwnerFieldName in interface Proxy

isOwner

public boolean isOwner(java.lang.Object pc,
                       java.lang.String fieldName)
Description copied from interface: Proxy
Return true if the given object and field name match the owner of this proxy.

Specified by:
isOwner in interface Proxy

getChangeManager

public com.solarmetric.rd.kodo.util.ChangeManager getChangeManager()

setChangeManager

public void setChangeManager(com.solarmetric.rd.kodo.util.ChangeManager cm)

getRemoved

public java.util.Collection getRemoved()

getAdded

public java.util.Collection getAdded()

clear

public void clear()
Specified by:
clear in interface java.util.Map
Overrides:
clear in class java.util.HashMap

keySet

public java.util.Set keySet()
Specified by:
keySet in interface java.util.Map
Overrides:
keySet in class java.util.HashMap

values

public java.util.Collection values()
Specified by:
values in interface java.util.Map
Overrides:
values in class java.util.HashMap

entrySet

public java.util.Set entrySet()
Specified by:
entrySet in interface java.util.Map
Overrides:
entrySet in class java.util.HashMap

put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Specified by:
put in interface java.util.Map
Overrides:
put in class java.util.HashMap

putAll

public void putAll(java.util.Map m)
Specified by:
putAll in interface java.util.Map
Overrides:
putAll in class java.util.HashMap

remove

public java.lang.Object remove(java.lang.Object key)
Specified by:
remove in interface java.util.Map
Overrides:
remove in class java.util.HashMap

writeReplace

protected java.lang.Object writeReplace()
                                 throws java.io.ObjectStreamException
java.io.ObjectStreamException

SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.