org.apache.ojb.broker.util.collections
Class RemovalAwareCollection
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.Vector
org.apache.ojb.broker.util.collections.ManageableVector
org.apache.ojb.broker.util.collections.RemovalAwareCollection
- All Implemented Interfaces:
- Serializable, Cloneable, Iterable, Collection, List, RandomAccess, ManageableCollection, IRemovalAwareCollection
public class RemovalAwareCollection
- extends ManageableVector
- implements IRemovalAwareCollection
This is a collection that tracks removal and addition of elements.
This tracking allow the PersistenceBroker to delete elements from
the database that have been removed from the collection before a
PB.store() orperation occurs.
This will allow to use the PB api in way pretty close to ODMG persistent
collections!
- Version:
- $Id: RemovalAwareCollection.java,v 1.1 2007-08-24 22:17:39 ewestfal Exp $
- Author:
- Thomas Mahler
- See Also:
- Serialized Form
Methods inherited from class java.util.Vector |
add, add, addAll, addAll, addElement, capacity, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, removeAll, removeElement, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize |
allObjectsToBeRemoved
private Vector allObjectsToBeRemoved
RemovalAwareCollection
public RemovalAwareCollection()
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
- Overrides:
afterStore
in class ManageableVector
- Parameters:
broker
- The persistence broker
- Throws:
PersistenceBrokerException
- See Also:
ManageableCollection.afterStore(PersistenceBroker broker)
remove
public Object remove(int index)
- Specified by:
remove
in interface List
- Overrides:
remove
in class Vector
- See Also:
List.remove(int)
registerForDeletion
protected void registerForDeletion(Object toBeRemoved)
remove
public boolean remove(Object o)
- Specified by:
remove
in interface Collection
- Specified by:
remove
in interface List
- Overrides:
remove
in class Vector
- See Also:
Collection.remove(Object)
clear
public void clear()
- Specified by:
clear
in interface Collection
- Specified by:
clear
in interface List
- Overrides:
clear
in class Vector
- See Also:
Vector.clear()
removeAllElements
public void removeAllElements()
- Overrides:
removeAllElements
in class Vector
- See Also:
Vector.removeAllElements()
removeElementAt
public void removeElementAt(int index)
- Overrides:
removeElementAt
in class Vector
- See Also:
Vector.removeElementAt(int)
removeRange
protected void removeRange(int fromIndex,
int toIndex)
- Overrides:
removeRange
in class Vector
- See Also:
AbstractList.removeRange(int, int)
Copyright © 2007-2011 The Kuali Foundation. All Rights Reserved.