org.apache.ojb.broker.util.collections
Class ManageableHashMap

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap
          extended by org.apache.ojb.broker.util.collections.ManageableHashMap
All Implemented Interfaces:
Serializable, Cloneable, Map, ManageableCollection

public class ManageableHashMap
extends HashMap
implements ManageableCollection

Creates a Map where the primary key is the map key, and the object is the map value.
Note: This implementation is limited in use, only objects with single primary key field are allowed (composed PK's are illegal).

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Constructor Summary
ManageableHashMap()
           
 
Method Summary
 void afterStore(PersistenceBroker broker)
          A callback method to implement 'removal-aware' (track removed objects and delete them by its own) collection implementations.
 void ojbAdd(Object anObject)
          Adds a single object to the Collection.
 void ojbAddAll(ManageableCollection otherCollection)
          Adds another collection to this collection.
 Iterator ojbIterator()
          Returns an iterator over all elements in the collection.
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
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
equals, hashCode
 

Constructor Detail

ManageableHashMap

public ManageableHashMap()
Method Detail

ojbAdd

public void ojbAdd(Object anObject)
Description copied from interface: ManageableCollection
Adds a single object to the Collection. This method is used during reading collection elements from the database. Thus it is safe to cast the object to the underlying element type of the collection.

Specified by:
ojbAdd in interface ManageableCollection
Parameters:
anObject - The object to add

ojbAddAll

public void ojbAddAll(ManageableCollection otherCollection)
Description copied from interface: ManageableCollection
Adds another collection to this collection. Used in reading extents from the database. Thus it is safe to cast the given collection to this class.

Specified by:
ojbAddAll in interface ManageableCollection
Parameters:
otherCollection - The added collection

ojbIterator

public Iterator ojbIterator()
Description copied from interface: ManageableCollection
Returns an iterator over all elements in the collection. Used during store and delete operations. If the implementor does not return an iterator over ALL elements, OJB cannot store and delete all elements properly.

Specified by:
ojbIterator in interface ManageableCollection
Returns:
The iterator

afterStore

public void afterStore(PersistenceBroker broker)
                throws PersistenceBrokerException
Description copied from interface: ManageableCollection
A callback method to implement 'removal-aware' (track removed objects and delete them by its own) collection implementations.

Specified by:
afterStore in interface ManageableCollection
Parameters:
broker - The persistence broker
Throws:
PersistenceBrokerException


Copyright © 2007-2011 The Kuali Foundation. All Rights Reserved.