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

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

public class ManageableArrayList
extends java.util.ArrayList
implements ManageableCollection

is a utility class. provides an ArrayList that addionally implements the ManageableCollection interface. This class may be used as a type for collection attributes.

Version:
$Id: ManageableArrayList.java,v 1.4 2003/04/09 08:57:48 arminw Exp $
Author:
Thomas Mahler
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
ManageableArrayList()
           
 
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(java.lang.Object anObject)
          add a single Object to the Collection.
 void ojbAddAll(ManageableCollection otherCollection)
          adds a Collection to this collection.
 java.util.Iterator ojbIterator()
          returns an Iterator over all elements in the collection.
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, removeRange, 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, remove, 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, remove, removeAll, retainAll, subList
 

Constructor Detail

ManageableArrayList

public ManageableArrayList()
Method Detail

ojbAdd

public void ojbAdd(java.lang.Object anObject)
add a single Object to the Collection. This method is used during reading Collection elements from the database. Thus it is is save to cast anObject to the underlying element type of the collection.

Specified by:
ojbAdd in interface ManageableCollection

ojbAddAll

public void ojbAddAll(ManageableCollection otherCollection)
adds a Collection to this collection. Used in reading Extents from the Database. Thus it is save to cast otherCollection to this.getClass().

Specified by:
ojbAddAll in interface ManageableCollection

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
Throws:
PersistenceBrokerException

ojbIterator

public java.util.Iterator ojbIterator()
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


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