org.springframework.datastore.collection
Class PersistentList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList
              extended by org.springframework.datastore.collection.PersistentList
All Implemented Interfaces:
Serializable, Cloneable, Iterable, Collection, List, RandomAccess, PersistentCollection

public class PersistentList
extends ArrayList
implements PersistentCollection

A lazy loaded list

Since:
1.0
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
PersistentList(Serializable associationKey, Session session, AssociationIndexer indexer)
           
 
Method Summary
 void add(int index, Object element)
           
 boolean add(Object o)
           
 boolean addAll(Collection c)
           
 boolean addAll(int index, Collection c)
           
 void clear()
           
 Object clone()
           
 boolean contains(Object o)
           
 boolean equals(Object o)
           
 Object get(int index)
           
 int hashCode()
           
 int indexOf(Object o)
           
 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()
           
 int lastIndexOf(Object o)
           
 ListIterator listIterator()
           
 ListIterator listIterator(int index)
           
 Object remove(int index)
           
 boolean remove(Object o)
           
protected  void removeRange(int fromIndex, int toIndex)
           
 Object set(int index, Object element)
           
 int size()
           
 List subList(int fromIndex, int toIndex)
           
 Object[] toArray()
           
 Object[] toArray(Object[] a)
           
 String toString()
           
 
Methods inherited from class java.util.ArrayList
ensureCapacity, trimToSize
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
containsAll, removeAll, retainAll
 

Constructor Detail

PersistentList

public PersistentList(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

size

public int size()
Specified by:
size in interface Collection
Specified by:
size in interface List
Overrides:
size in class ArrayList

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection
Specified by:
isEmpty in interface List
Overrides:
isEmpty in class ArrayList

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection
Specified by:
contains in interface List
Overrides:
contains in class ArrayList

indexOf

public int indexOf(Object o)
Specified by:
indexOf in interface List
Overrides:
indexOf in class ArrayList

lastIndexOf

public int lastIndexOf(Object o)
Specified by:
lastIndexOf in interface List
Overrides:
lastIndexOf in class ArrayList

clone

public Object clone()
Overrides:
clone in class ArrayList

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection
Specified by:
toArray in interface List
Overrides:
toArray in class ArrayList

toArray

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

get

public Object get(int index)
Specified by:
get in interface List
Overrides:
get in class ArrayList

set

public Object set(int index,
                  Object element)
Specified by:
set in interface List
Overrides:
set in class ArrayList

add

public boolean add(Object o)
Specified by:
add in interface Collection
Specified by:
add in interface List
Overrides:
add in class ArrayList

add

public void add(int index,
                Object element)
Specified by:
add in interface List
Overrides:
add in class ArrayList

remove

public Object remove(int index)
Specified by:
remove in interface List
Overrides:
remove in class ArrayList

remove

public boolean remove(Object o)
Specified by:
remove in interface Collection
Specified by:
remove in interface List
Overrides:
remove in class ArrayList

clear

public void clear()
Specified by:
clear in interface Collection
Specified by:
clear in interface List
Overrides:
clear in class ArrayList

addAll

public boolean addAll(Collection c)
Specified by:
addAll in interface Collection
Specified by:
addAll in interface List
Overrides:
addAll in class ArrayList

addAll

public boolean addAll(int index,
                      Collection c)
Specified by:
addAll in interface List
Overrides:
addAll in class ArrayList

removeRange

protected void removeRange(int fromIndex,
                           int toIndex)
Overrides:
removeRange in class ArrayList

iterator

public Iterator iterator()
Specified by:
iterator in interface Iterable
Specified by:
iterator in interface Collection
Specified by:
iterator in interface List
Overrides:
iterator in class AbstractList

listIterator

public ListIterator listIterator()
Specified by:
listIterator in interface List
Overrides:
listIterator in class AbstractList

listIterator

public ListIterator listIterator(int index)
Specified by:
listIterator in interface List
Overrides:
listIterator in class AbstractList

subList

public List subList(int fromIndex,
                    int toIndex)
Specified by:
subList in interface List
Overrides:
subList in class AbstractList

equals

public boolean equals(Object o)
Specified by:
equals in interface Collection
Specified by:
equals in interface List
Overrides:
equals in class AbstractList

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection
Specified by:
hashCode in interface List
Overrides:
hashCode in class AbstractList

toString

public String toString()
Overrides:
toString in class AbstractCollection

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