public class CollectionProxyDefaultImpl extends java.lang.Object implements java.util.Collection, ManageableCollection, CollectionProxy
| Constructor and Description |
|---|
CollectionProxyDefaultImpl(PBKey brokerKey,
java.lang.Class collClass,
Query query)
Creates a new collection proxy that uses the given collection type.
|
CollectionProxyDefaultImpl(PBKey brokerKey,
Query query)
Creates a new collection proxy (uses
RemovalAwareCollection
as the collection class). |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(java.lang.Object o) |
boolean |
addAll(java.util.Collection c) |
void |
addListener(CollectionProxyListener listener)
Adds a listener to this collection.
|
void |
afterStore(PersistenceBroker broker)
A callback method to implement 'removal-aware' (track removed objects and delete
them by its own) collection implementations.
|
void |
clear()
Clears the proxy.
|
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection c) |
PBKey |
getBrokerKey()
Returns the key of the persistence broker used by this collection.
|
java.lang.Class |
getCollectionClass()
Returns the collection type.
|
java.util.Collection |
getData()
Returns the collection data, load it if not already done so.
|
Query |
getQuery()
Returns the defining query.
|
boolean |
isEmpty() |
boolean |
isLoaded()
Determines whether the collection data already has been loaded from the database.
|
java.util.Iterator |
iterator() |
void |
ojbAdd(java.lang.Object anObject)
Adds a single object to the Collection.
|
void |
ojbAddAll(ManageableCollection otherCollection)
Adds another collection to this collection.
|
java.util.Iterator |
ojbIterator()
Returns an iterator over all elements in the collection.
|
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection c) |
void |
removeListener(CollectionProxyListener listener)
Removes the given listener from this collecton.
|
boolean |
retainAll(java.util.Collection c) |
void |
setData(java.util.Collection data)
Sets the collection data.
|
void |
setProfileKey(java.lang.Object profileKey)
Sets the metadata profile key used when creating this proxy.
|
int |
size() |
java.lang.Object[] |
toArray() |
java.lang.Object[] |
toArray(java.lang.Object[] a) |
public CollectionProxyDefaultImpl(PBKey brokerKey, Query query)
RemovalAwareCollection
as the collection class).brokerKey - The key of the persistence brokerquery - The defining querypublic boolean isLoaded()
isLoaded in interface CollectionProxytrue if the data is already loadedpublic int size()
size in interface java.util.CollectionCollection.size()public boolean isEmpty()
isEmpty in interface java.util.CollectionCollection.isEmpty()public boolean contains(java.lang.Object o)
contains in interface java.util.CollectionCollection.contains(Object)public java.util.Iterator iterator()
iterator in interface java.lang.Iterableiterator in interface java.util.CollectionCollection.iterator()public java.lang.Object[] toArray()
toArray in interface java.util.CollectionCollection.toArray()public java.lang.Object[] toArray(java.lang.Object[] a)
toArray in interface java.util.CollectionCollection.toArray(Object[])public boolean add(java.lang.Object o)
add in interface java.util.CollectionCollection.add(Object)public boolean remove(java.lang.Object o)
remove in interface java.util.CollectionCollection.remove(Object)public boolean containsAll(java.util.Collection c)
containsAll in interface java.util.CollectionCollection.containsAll(Collection)public boolean addAll(java.util.Collection c)
addAll in interface java.util.CollectionCollection.addAll(Collection)public boolean removeAll(java.util.Collection c)
removeAll in interface java.util.CollectionCollection.removeAll(Collection)public boolean retainAll(java.util.Collection c)
retainAll in interface java.util.CollectionCollection.retainAll(Collection)public void clear()
clear in interface java.util.CollectionCollection.clear()public Query getQuery()
public java.util.Collection getData()
public void setData(java.util.Collection data)
data - The datapublic java.lang.Class getCollectionClass()
public void ojbAdd(java.lang.Object anObject)
ManageableCollectionojbAdd in interface ManageableCollectionanObject - The object to addManageableCollection.ojbAdd(Object)public void ojbAddAll(ManageableCollection otherCollection)
ManageableCollectionojbAddAll in interface ManageableCollectionotherCollection - The added collectionManageableCollection.ojbAddAll(ManageableCollection)public java.util.Iterator ojbIterator()
ManageableCollectionojbIterator in interface ManageableCollectionManageableCollection.ojbIterator()public void afterStore(PersistenceBroker broker) throws PersistenceBrokerException
ManageableCollectionafterStore in interface ManageableCollectionbroker - The persistence brokerPersistenceBrokerExceptionManageableCollection.afterStore(PersistenceBroker broker)public PBKey getBrokerKey()
public void setProfileKey(java.lang.Object profileKey)
profileKey - the metadata profile keypublic void addListener(CollectionProxyListener listener)
addListener in interface CollectionProxylistener - The listener to addpublic void removeListener(CollectionProxyListener listener)
removeListener in interface CollectionProxylistener - The listener to remove(C) 2002 - 2005 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