Package org.castor.persist.proxy
Class LazyHashSet<E>
java.lang.Object
org.castor.persist.proxy.LazyHashSet<E>
- All Implemented Interfaces:
Iterable<E>
,Collection<E>
,Set<E>
,LazyCollection<E>
,TxSynchronizable
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
ConstructorsConstructorDescriptionLazyHashSet
(TransactionContext tx, ClassMolder molder, List<Identity> ids) Creates an instance of LazyHashSet. -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection<? extends E> collection) void
clear()
void
Called at the end of a transaction after commit.boolean
boolean
containsAll
(Collection<?> collection) boolean
int
hashCode()
boolean
isEmpty()
iterator()
boolean
boolean
removeAll
(Collection<?> collection) boolean
retainAll
(Collection<?> collection) void
Called at the end of a transaction after rollback.int
size()
Object[]
toArray()
<A> A[]
toArray
(A[] array) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.Set
spliterator
-
Constructor Details
-
LazyHashSet
Creates an instance of LazyHashSet.- Parameters:
tx
- Current transaction contextmolder
- Associated ClassMolderids
- Set of identifiers.
-
-
Method Details
-
add
-
addAll
-
clear
public void clear() -
contains
-
containsAll
- Specified by:
containsAll
in interfaceCollection<E>
- Specified by:
containsAll
in interfaceSet<E>
-
isEmpty
public boolean isEmpty() -
iterator
-
remove
-
removeAll
-
retainAll
-
size
public int size() -
toArray
-
toArray
public <A> A[] toArray(A[] array) -
equals
-
hashCode
public int hashCode() -
getIdsList
- Specified by:
getIdsList
in interfaceLazyCollection<E>
-
getRemovedIdsList
- Specified by:
getRemovedIdsList
in interfaceLazyCollection<E>
-
getAddedEntitiesList
- Specified by:
getAddedEntitiesList
in interfaceLazyCollection<E>
-
committed
Description copied from interface:TxSynchronizable
Called at the end of a transaction after commit.- Specified by:
committed
in interfaceTxSynchronizable
-
rolledback
Description copied from interface:TxSynchronizable
Called at the end of a transaction after rollback.- Specified by:
rolledback
in interfaceTxSynchronizable
-