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

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byjava.util.Vector
              extended byorg.apache.ojb.broker.util.collections.ManageableVector
                  extended byorg.apache.ojb.broker.util.collections.RemovalAwareCollection
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, IRemovalAwareCollection, java.util.List, ManageableCollection, java.util.RandomAccess, java.io.Serializable

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.7.2.1 2005/03/11 11:31:05 mkalen Exp $
Author:
Thomas Mahler
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.apache.ojb.broker.ManageableCollection
serialVersionUID
 
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
Throws:
PersistenceBrokerException
See Also:
ManageableCollection.afterStore(PersistenceBroker broker)

remove

public java.lang.Object remove(int index)
Specified by:
remove in interface java.util.List
See Also:
List.remove(int)

remove

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

clear

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

removeAllElements

public void removeAllElements()
See Also:
Vector.removeAllElements()

removeElementAt

public void removeElementAt(int index)
See Also:
Vector.removeElementAt(int)


(C) 2002 - 2004 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.3, 2005-04-2