Package net.ontopia.persistence.proxy
Class IdentityCollectionWrapper<E>
- java.lang.Object
-
- net.ontopia.persistence.proxy.IdentityCollectionWrapper<E>
-
- All Implemented Interfaces:
Iterable<E>,Collection<E>
public class IdentityCollectionWrapper<E> extends Object implements Collection<E>
INTERNAL: A set implementation that wraps an identity collection and presents the underlying collection as if it had PersistentIF instances inside. All identity lookup is done lazily, and no state is stored by this instance except for the current TransactionIF and the wrapped identities collection.
-
-
Field Summary
Fields Modifier and Type Field Description protected Collection<?>otherprotected TransactionIFtxn
-
Constructor Summary
Constructors Constructor Description IdentityCollectionWrapper(TransactionIF txn, Collection<?> identities)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(E o)booleanaddAll(Collection<? extends E> c)voidclear()booleancontains(Object o)booleancontainsAll(Collection<?> c)booleanisEmpty()Iterator<E>iterator()booleanremove(Object o)booleanremoveAll(Collection<?> c)booleanretainAll(Collection<?> c)intsize()Object[]toArray()<T> T[]toArray(T[] a)StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
-
-
-
Field Detail
-
txn
protected final TransactionIF txn
-
other
protected final Collection<?> other
-
-
Constructor Detail
-
IdentityCollectionWrapper
public IdentityCollectionWrapper(TransactionIF txn, Collection<?> identities)
-
-
Method Detail
-
clear
public void clear()
- Specified by:
clearin interfaceCollection<E>
-
add
public boolean add(E o)
- Specified by:
addin interfaceCollection<E>
-
addAll
public boolean addAll(Collection<? extends E> c)
- Specified by:
addAllin interfaceCollection<E>
-
remove
public boolean remove(Object o)
- Specified by:
removein interfaceCollection<E>
-
removeAll
public boolean removeAll(Collection<?> c)
- Specified by:
removeAllin interfaceCollection<E>
-
retainAll
public boolean retainAll(Collection<?> c)
- Specified by:
retainAllin interfaceCollection<E>
-
size
public int size()
- Specified by:
sizein interfaceCollection<E>
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceCollection<E>
-
contains
public boolean contains(Object o)
- Specified by:
containsin interfaceCollection<E>
-
containsAll
public boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<E>
-
toArray
public Object[] toArray()
- Specified by:
toArrayin interfaceCollection<E>
-
toArray
public <T> T[] toArray(T[] a)
- Specified by:
toArrayin interfaceCollection<E>
-
-