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 boolean
add(E entity)
boolean
addAll(java.util.Collection<? extends E> collection)
void
clear()
void
committed(TransactionContext tx)
Called at the end of a transaction after commit.boolean
contains(java.lang.Object entity)
boolean
containsAll(java.util.Collection<?> collection)
boolean
equals(java.lang.Object o)
java.util.List<E>
getAddedEntitiesList()
java.util.List<Identity>
getIdsList()
java.util.List<Identity>
getRemovedIdsList()
int
hashCode()
boolean
isEmpty()
java.util.Iterator<E>
iterator()
boolean
remove(java.lang.Object entity)
boolean
removeAll(java.util.Collection<?> collection)
boolean
retainAll(java.util.Collection<?> collection)
void
rolledback(TransactionContext tx)
Called at the end of a transaction after rollback.int
size()
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:
getIdsList
in interfaceLazyCollection<E>
-
getRemovedIdsList
public java.util.List<Identity> getRemovedIdsList()
- Specified by:
getRemovedIdsList
in interfaceLazyCollection<E>
-
getAddedEntitiesList
public java.util.List<E> getAddedEntitiesList()
- Specified by:
getAddedEntitiesList
in interfaceLazyCollection<E>
-
committed
public void committed(TransactionContext tx)
Description copied from interface:TxSynchronizable
Called at the end of a transaction after commit.- Specified by:
committed
in interfaceTxSynchronizable
-
rolledback
public void rolledback(TransactionContext tx)
Description copied from interface:TxSynchronizable
Called at the end of a transaction after rollback.- Specified by:
rolledback
in interfaceTxSynchronizable
-
-