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 CollectionProxy
true
if the data is already loadedpublic int size()
size
in interface java.util.Collection
Collection.size()
public boolean isEmpty()
isEmpty
in interface java.util.Collection
Collection.isEmpty()
public boolean contains(java.lang.Object o)
contains
in interface java.util.Collection
Collection.contains(Object)
public java.util.Iterator iterator()
iterator
in interface java.lang.Iterable
iterator
in interface java.util.Collection
Collection.iterator()
public java.lang.Object[] toArray()
toArray
in interface java.util.Collection
Collection.toArray()
public java.lang.Object[] toArray(java.lang.Object[] a)
toArray
in interface java.util.Collection
Collection.toArray(Object[])
public boolean add(java.lang.Object o)
add
in interface java.util.Collection
Collection.add(Object)
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection
Collection.remove(Object)
public boolean containsAll(java.util.Collection c)
containsAll
in interface java.util.Collection
Collection.containsAll(Collection)
public boolean addAll(java.util.Collection c)
addAll
in interface java.util.Collection
Collection.addAll(Collection)
public boolean removeAll(java.util.Collection c)
removeAll
in interface java.util.Collection
Collection.removeAll(Collection)
public boolean retainAll(java.util.Collection c)
retainAll
in interface java.util.Collection
Collection.retainAll(Collection)
public void clear()
clear
in interface java.util.Collection
Collection.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)
ManageableCollection
ojbAdd
in interface ManageableCollection
anObject
- The object to addManageableCollection.ojbAdd(Object)
public void ojbAddAll(ManageableCollection otherCollection)
ManageableCollection
ojbAddAll
in interface ManageableCollection
otherCollection
- The added collectionManageableCollection.ojbAddAll(ManageableCollection)
public java.util.Iterator ojbIterator()
ManageableCollection
ojbIterator
in interface ManageableCollection
ManageableCollection.ojbIterator()
public void afterStore(PersistenceBroker broker) throws PersistenceBrokerException
ManageableCollection
afterStore
in interface ManageableCollection
broker
- The persistence brokerPersistenceBrokerException
ManageableCollection.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 CollectionProxy
listener
- The listener to addpublic void removeListener(CollectionProxyListener listener)
removeListener
in interface CollectionProxy
listener
- 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