org.apache.ojb.broker.util.collections
Class ManageableHashSet
java.lang.Object
java.util.AbstractCollection
java.util.AbstractSet
java.util.HashSet
org.apache.ojb.broker.util.collections.ManageableHashSet
- All Implemented Interfaces:
- java.lang.Cloneable, java.util.Collection, ManageableCollection, java.io.Serializable, java.util.Set
- public class ManageableHashSet
- extends java.util.HashSet
- implements ManageableCollection
is a utility class. provides a HashSet that addionally implements
the ManageableCollection interface. This class may be used
as a type for collection attributes.
- Version:
- $Id: ManageableHashSet.java,v 1.7 2004/05/22 09:51:25 brj Exp $
- Author:
- Thomas Mahler
- See Also:
- Serialized Form
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.HashSet |
add, clear, clone, contains, isEmpty, iterator, remove, size |
Methods inherited from class java.util.AbstractSet |
equals, hashCode, removeAll |
Methods inherited from class java.util.AbstractCollection |
addAll, containsAll, retainAll, toArray, toArray, toString |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Set |
addAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArray |
ManageableHashSet
public ManageableHashSet()
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
(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