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

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector
              extended by org.apache.ojb.broker.util.collections.ManageableVector
                  extended by org.apache.ojb.broker.util.collections.RemovalAwareCollection
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.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 365232 2005-12-21 22:36:07Z tomdz $
Author:
Thomas Mahler
See Also:
Serialized Form

Constructor Summary
RemovalAwareCollection()
           
 
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 clear()
           
 java.lang.Object remove(int index)
           
 boolean remove(java.lang.Object o)
           
 void removeAllElements()
           
 void removeElementAt(int index)
           
 
Methods inherited from class org.apache.ojb.broker.util.collections.ManageableVector
ojbAdd, ojbAddAll, ojbIterator
 
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
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

RemovalAwareCollection

public RemovalAwareCollection()
Method Detail

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 java.lang.Object remove(int index)
Specified by:
remove in interface java.util.List
Overrides:
remove in class java.util.Vector
See Also:
List.remove(int)

remove

public boolean remove(java.lang.Object o)
Specified by:
remove in interface java.util.Collection
Specified by:
remove in interface java.util.List
Overrides:
remove in class java.util.Vector
See Also:
Collection.remove(Object)

clear

public void clear()
Specified by:
clear in interface java.util.Collection
Specified by:
clear in interface java.util.List
Overrides:
clear in class java.util.Vector
See Also:
Vector.clear()

removeAllElements

public void removeAllElements()
Overrides:
removeAllElements in class java.util.Vector
See Also:
Vector.removeAllElements()

removeElementAt

public void removeElementAt(int index)
Overrides:
removeElementAt in class java.util.Vector
See Also:
Vector.removeElementAt(int)


(C) 2002 - 2006 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30