org.castor.persist.proxy
Class RelationCollection

java.lang.Object
  extended by org.castor.persist.proxy.RelationCollection
All Implemented Interfaces:
Iterable, Collection, Lazy, TxSynchronizable

public final class RelationCollection
extends Object
implements Collection, Lazy, TxSynchronizable

RelationCollection implements Collection It is a lazy Colllection. The collection initially contains only the identities of elements of one type. If any element is needed, it will be fetched "on the fly".

Author:
Thomas Yip

Constructor Summary
RelationCollection(TransactionContext tx, OID enclosing, ClassMolder molder, AccessMode amode, ArrayList ids)
          Creates an instance of RelationCollection.
 
Method Summary
 boolean add(Object o)
           
 boolean addAll(Collection c)
           
 void clear()
           
 void committed(TransactionContext tx)
          Called at the end of a transaction after commit.
 boolean contains(Object o)
           
 boolean containsAll(Collection c)
           
 boolean equals(Object o)
           
 Object find(Object ids)
           
 ArrayList getAdded()
           
 ArrayList getDeleted()
           
 ArrayList getIdentitiesList()
           
 int hashCode()
           
 boolean isEmpty()
           
 Iterator iterator()
           
 boolean remove(Object o)
           
 boolean removeAll(Collection c)
           
 boolean retainAll(Collection c)
           
 void rolledback(TransactionContext tx)
          Called at the end of a transaction after rollback.
 int size()
           
 Object[] toArray()
           
 Object[] toArray(Object[] a)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RelationCollection

public RelationCollection(TransactionContext tx,
                          OID enclosing,
                          ClassMolder molder,
                          AccessMode amode,
                          ArrayList ids)
Creates an instance of RelationCollection.

Parameters:
tx - Current transaction context
enclosing - Enclosing OID
molder - Associated ClassMolder
amode - Access mode
ids - Set of identifiers.
Method Detail

add

public boolean add(Object o)
Specified by:
add in interface Collection

addAll

public boolean addAll(Collection c)
Specified by:
addAll in interface Collection

clear

public void clear()
Specified by:
clear in interface Collection

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection

containsAll

public boolean containsAll(Collection c)
Specified by:
containsAll in interface Collection

equals

public boolean equals(Object o)
Specified by:
equals in interface Collection
Overrides:
equals in class Object

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection
Overrides:
hashCode in class Object

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection

iterator

public Iterator iterator()
Specified by:
iterator in interface Iterable
Specified by:
iterator in interface Collection

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection

removeAll

public boolean removeAll(Collection c)
Specified by:
removeAll in interface Collection

retainAll

public boolean retainAll(Collection c)
Specified by:
retainAll in interface Collection

size

public int size()
Specified by:
size in interface Collection

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection

toArray

public Object[] toArray(Object[] a)
Specified by:
toArray in interface Collection

getIdentitiesList

public ArrayList getIdentitiesList()

find

public Object find(Object ids)

getDeleted

public ArrayList getDeleted()

getAdded

public ArrayList getAdded()

committed

public void committed(TransactionContext tx)
Description copied from interface: TxSynchronizable
Called at the end of a transaction after commit.

Specified by:
committed in interface TxSynchronizable

rolledback

public void rolledback(TransactionContext tx)
Description copied from interface: TxSynchronizable
Called at the end of a transaction after rollback.

Specified by:
rolledback in interface TxSynchronizable


Copyright © 2010. All Rights Reserved.