org.springframework.datastore.collection
Class PersistentSet

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<E>
          extended by java.util.HashSet
              extended by org.springframework.datastore.collection.PersistentSet
All Implemented Interfaces:
Serializable, Cloneable, Iterable, Collection, Set, PersistentCollection

public class PersistentSet
extends HashSet
implements PersistentCollection

A lazy loaded set

Since:
1.0
See Also:
Serialized Form

Constructor Summary
PersistentSet(Serializable associationKey, Session session, AssociationIndexer indexer)
           
 
Method Summary
 boolean add(Object o)
           
 boolean addAll(Collection c)
           
 void clear()
           
 Object clone()
           
 boolean contains(Object o)
           
 boolean containsAll(Collection c)
           
 boolean equals(Object o)
           
 int hashCode()
           
 void initialize()
          Initializes the collection if it hasn't already been initialized
 boolean isEmpty()
           
 boolean isInitialized()
          Check whether the collection has been loaded
 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
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PersistentSet

public PersistentSet(Serializable associationKey,
                     Session session,
                     AssociationIndexer indexer)
Method Detail

isInitialized

public boolean isInitialized()
Description copied from interface: PersistentCollection
Check whether the collection has been loaded

Specified by:
isInitialized in interface PersistentCollection
Returns:
True if the collection has been initialized

initialize

public void initialize()
Description copied from interface: PersistentCollection
Initializes the collection if it hasn't already been initialized

Specified by:
initialize in interface PersistentCollection

toString

public String toString()
Overrides:
toString in class AbstractCollection

iterator

public Iterator iterator()
Specified by:
iterator in interface Iterable
Specified by:
iterator in interface Collection
Specified by:
iterator in interface Set
Overrides:
iterator in class HashSet

size

public int size()
Specified by:
size in interface Collection
Specified by:
size in interface Set
Overrides:
size in class HashSet

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection
Specified by:
isEmpty in interface Set
Overrides:
isEmpty in class HashSet

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection
Specified by:
contains in interface Set
Overrides:
contains in class HashSet

add

public boolean add(Object o)
Specified by:
add in interface Collection
Specified by:
add in interface Set
Overrides:
add in class HashSet

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection
Specified by:
remove in interface Set
Overrides:
remove in class HashSet

clear

public void clear()
Specified by:
clear in interface Collection
Specified by:
clear in interface Set
Overrides:
clear in class HashSet

clone

public Object clone()
Overrides:
clone in class HashSet

equals

public boolean equals(Object o)
Specified by:
equals in interface Collection
Specified by:
equals in interface Set
Overrides:
equals in class AbstractSet

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection
Specified by:
hashCode in interface Set
Overrides:
hashCode in class AbstractSet

removeAll

public boolean removeAll(Collection c)
Specified by:
removeAll in interface Collection
Specified by:
removeAll in interface Set
Overrides:
removeAll in class AbstractSet

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection
Specified by:
toArray in interface Set
Overrides:
toArray in class AbstractCollection

toArray

public Object[] toArray(Object[] a)
Specified by:
toArray in interface Collection
Specified by:
toArray in interface Set
Overrides:
toArray in class AbstractCollection

containsAll

public boolean containsAll(Collection c)
Specified by:
containsAll in interface Collection
Specified by:
containsAll in interface Set
Overrides:
containsAll in class AbstractCollection

addAll

public boolean addAll(Collection c)
Specified by:
addAll in interface Collection
Specified by:
addAll in interface Set
Overrides:
addAll in class AbstractCollection

retainAll

public boolean retainAll(Collection c)
Specified by:
retainAll in interface Collection
Specified by:
retainAll in interface Set
Overrides:
retainAll in class AbstractCollection