net.ontopia.persistence.proxy
Class IdentityCollectionWrapper

java.lang.Object
  extended by net.ontopia.persistence.proxy.IdentityCollectionWrapper
All Implemented Interfaces:
Iterable, Collection

public class IdentityCollectionWrapper
extends Object
implements Collection

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
protected  Collection other
           
protected  TransactionIF txn
           
 
Constructor Summary
IdentityCollectionWrapper(TransactionIF txn, Collection identities)
           
 
Method Summary
 boolean add(Object o)
           
 boolean addAll(Collection c)
           
 void clear()
           
 boolean contains(Object o)
           
 boolean containsAll(Collection c)
           
 boolean isEmpty()
           
 Iterator iterator()
           
 boolean remove(Object o)
           
 boolean removeAll(Collection c)
           
 boolean retainAll(Collection c)
           
 int size()
           
 Object[] toArray()
           
 Object[] toArray(Object[] a)
           
 String toString()
           
 
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
 

Field Detail

txn

protected TransactionIF txn

other

protected Collection other
Constructor Detail

IdentityCollectionWrapper

public IdentityCollectionWrapper(TransactionIF txn,
                                 Collection identities)
Method Detail

clear

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

add

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

addAll

public boolean addAll(Collection c)
Specified by:
addAll 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

isEmpty

public boolean isEmpty()
Specified by:
isEmpty 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

toArray

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

toArray

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

toString

public String toString()
Overrides:
toString in class Object

iterator

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


Copyright © 2000-2012 Ontopia.