org.compass.core.converter.mapping.osem.collection
Class LazyReferenceList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList
          extended by org.compass.core.converter.mapping.osem.collection.LazyReferenceList
All Implemented Interfaces:
Iterable, Collection, List, LazyReferenceCollection

public class LazyReferenceList
extends AbstractList
implements LazyReferenceCollection

A lazy reference list. If no dirty operations are perfomed, will lazily load references from the search engine. Once a dirty operation is perfomed, will loadFully(), and then all operations will be perfoemd on the loaded list.

Author:
kimchy

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
LazyReferenceList(InternalCompassSession session, int size)
           
 
Method Summary
 void add(int index, Object element)
           
 boolean add(Object o)
           
 boolean addAll(Collection c)
           
 boolean addAll(int index, Collection c)
           
 void addLazyEntry(LazyReferenceEntry entry)
          Internally used to initialize the lazy collection.
 void clear()
           
 boolean contains(Object o)
           
 boolean containsAll(Collection c)
           
 Object get(int index)
           
 int indexOf(Object o)
           
 boolean isFullyLoaded()
          Returns true if the collection is fully loaded from the index.
 int lastIndexOf(Object o)
           
 void loadFully()
          Loads all the referneced objects into memory from the search engine.
 Object remove(int index)
           
 boolean remove(Object o)
           
 boolean removeAll(Collection c)
           
 Object set(int index, Object element)
           
 int size()
           
 Object[] toArray()
           
 Object[] toArray(Object[] a)
           
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, removeRange, subList
 
Methods inherited from class java.util.AbstractCollection
isEmpty, retainAll, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
equals, hashCode, isEmpty, iterator, retainAll
 
Methods inherited from interface java.util.List
isEmpty, retainAll
 

Constructor Detail

LazyReferenceList

public LazyReferenceList(InternalCompassSession session,
                         int size)
Method Detail

addLazyEntry

public void addLazyEntry(LazyReferenceEntry entry)
Description copied from interface: LazyReferenceCollection
Internally used to initialize the lazy collection.

Specified by:
addLazyEntry in interface LazyReferenceCollection

get

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

size

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

add

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

remove

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

add

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

set

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

indexOf

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

lastIndexOf

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

clear

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

addAll

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

contains

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

remove

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

toArray

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

toArray

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

containsAll

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

addAll

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

removeAll

public boolean removeAll(Collection c)
Specified by:
removeAll in interface Collection
Specified by:
removeAll in interface List
Overrides:
removeAll in class AbstractCollection

isFullyLoaded

public boolean isFullyLoaded()
Description copied from interface: LazyReferenceCollection
Returns true if the collection is fully loaded from the index.

Specified by:
isFullyLoaded in interface LazyReferenceCollection

loadFully

public void loadFully()
Description copied from interface: LazyReferenceCollection
Loads all the referneced objects into memory from the search engine.

Specified by:
loadFully in interface LazyReferenceCollection


Copyright (c) 2004-2008 The Compass Project.