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

java.lang.Object
  extended byjava.util.AbstractCollection
      extended byjava.util.AbstractList
          extended byjava.util.ArrayList
              extended byorg.apache.ojb.broker.util.collections.ManageableArrayList
                  extended byorg.apache.ojb.broker.util.collections.RemovalAwareList
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, ManageableCollection, java.util.RandomAccess, java.io.Serializable

public class RemovalAwareList
extends ManageableArrayList

This is a list 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!

Author:
Thomas Mahler, adapted to ManageableArrayList by Edson C. E. Richter
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Fields inherited from interface org.apache.ojb.broker.ManageableCollection
serialVersionUID
 
Constructor Summary
RemovalAwareList()
           
 
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()
           
protected  void registerForDeletion(java.lang.Object toBeRemoved)
           
 java.lang.Object remove(int index)
           
 boolean remove(java.lang.Object o)
           
 void removeAllElements()
           
 void removeElementAt(int index)
           
protected  void removeRange(int fromIndex, int toIndex)
           
 void resetDeleted()
           
 
Methods inherited from class org.apache.ojb.broker.util.collections.ManageableArrayList
ojbAdd, ojbAddAll, ojbIterator
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Constructor Detail

RemovalAwareList

public RemovalAwareList()
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 ManageableArrayList
Throws:
PersistenceBrokerException
See Also:
ManageableCollection.afterStore(PersistenceBroker broker)

remove

public java.lang.Object remove(int index)
See Also:
List.remove(int)

registerForDeletion

protected void registerForDeletion(java.lang.Object toBeRemoved)

remove

public boolean remove(java.lang.Object o)
See Also:
Collection.remove(Object)

removeAllElements

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

removeElementAt

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

clear

public void clear()

removeRange

protected void removeRange(int fromIndex,
                           int toIndex)
See Also:
AbstractList.removeRange(int, int)

resetDeleted

public void resetDeleted()


Authors: Thomas Mahler and others. (C) 2000 - 2003 Apache Software Foundation
All rights reserved. Published under the Apache License.
http://db.apache.org/ojb
Version: 1.0.rc5, 2003-12-14