Package org.castor.persist.proxy
Class LazyHashSet<E>
- java.lang.Object
-
- org.castor.persist.proxy.LazyHashSet<E>
-
- All Implemented Interfaces:
java.lang.Iterable<E>,java.util.Collection<E>,java.util.Set<E>,LazyCollection<E>,TxSynchronizable
public final class LazyHashSet<E> extends java.lang.Object implements LazyCollection<E>, java.util.Set<E>
It is a lazy Collection. The collection initially contains only the identities of elements of one type. If any element is needed, it will be fetched "on the fly".- Version:
- $Revision$ $Date: 2009-07-13 17:22:43 (Mon, 13 Jul 2009) $
- Author:
- Thomas Yip, Werner Guttmann, Ralf Joachim
-
-
Constructor Summary
Constructors Constructor Description LazyHashSet(TransactionContext tx, ClassMolder molder, java.util.List<Identity> ids)Creates an instance of LazyHashSet.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(E entity)booleanaddAll(java.util.Collection<? extends E> collection)voidclear()voidcommitted(TransactionContext tx)Called at the end of a transaction after commit.booleancontains(java.lang.Object entity)booleancontainsAll(java.util.Collection<?> collection)booleanequals(java.lang.Object o)java.util.List<E>getAddedEntitiesList()java.util.List<Identity>getIdsList()java.util.List<Identity>getRemovedIdsList()inthashCode()booleanisEmpty()java.util.Iterator<E>iterator()booleanremove(java.lang.Object entity)booleanremoveAll(java.util.Collection<?> collection)booleanretainAll(java.util.Collection<?> collection)voidrolledback(TransactionContext tx)Called at the end of a transaction after rollback.intsize()java.lang.Object[]toArray()<A> A[]toArray(A[] array)
-
-
-
Constructor Detail
-
LazyHashSet
public LazyHashSet(TransactionContext tx, ClassMolder molder, java.util.List<Identity> ids)
Creates an instance of LazyHashSet.- Parameters:
tx- Current transaction contextmolder- Associated ClassMolderids- Set of identifiers.
-
-
Method Detail
-
add
public boolean add(E entity)
-
addAll
public boolean addAll(java.util.Collection<? extends E> collection)
-
clear
public void clear()
-
contains
public boolean contains(java.lang.Object entity)
-
containsAll
public boolean containsAll(java.util.Collection<?> collection)
-
isEmpty
public boolean isEmpty()
-
iterator
public java.util.Iterator<E> iterator()
-
remove
public boolean remove(java.lang.Object entity)
-
removeAll
public boolean removeAll(java.util.Collection<?> collection)
-
retainAll
public boolean retainAll(java.util.Collection<?> collection)
-
size
public int size()
-
toArray
public java.lang.Object[] toArray()
-
toArray
public <A> A[] toArray(A[] array)
-
equals
public boolean equals(java.lang.Object o)
-
hashCode
public int hashCode()
-
getIdsList
public java.util.List<Identity> getIdsList()
- Specified by:
getIdsListin interfaceLazyCollection<E>
-
getRemovedIdsList
public java.util.List<Identity> getRemovedIdsList()
- Specified by:
getRemovedIdsListin interfaceLazyCollection<E>
-
getAddedEntitiesList
public java.util.List<E> getAddedEntitiesList()
- Specified by:
getAddedEntitiesListin interfaceLazyCollection<E>
-
committed
public void committed(TransactionContext tx)
Description copied from interface:TxSynchronizableCalled at the end of a transaction after commit.- Specified by:
committedin interfaceTxSynchronizable
-
rolledback
public void rolledback(TransactionContext tx)
Description copied from interface:TxSynchronizableCalled at the end of a transaction after rollback.- Specified by:
rolledbackin interfaceTxSynchronizable
-
-