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

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

public class LazyReferenceSet
extends AbstractSet
implements LazyReferenceCollection

A lazy reference set. 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

Constructor Summary
LazyReferenceSet(InternalCompassSession session, int size, AbstractCollectionMapping.CollectionType collectionType)
           
 
Method Summary
 boolean add(Object o)
           
 boolean addAll(Collection c)
           
 void addLazyEntry(LazyReferenceEntry entry)
          Internally used to initialize the lazy collection.
 void clear()
           
 boolean contains(Object o)
           
 boolean isFullyLoaded()
          Returns true if the collection is fully loaded from the index.
 Iterator iterator()
           
 void loadFully()
          Loads all the referneced objects into memory from the search engine.
 boolean remove(Object o)
           
 boolean removeAll(Collection c)
           
 int size()
           
 
Methods inherited from class java.util.AbstractSet
equals, hashCode
 
Methods inherited from class java.util.AbstractCollection
containsAll, isEmpty, retainAll, toArray, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
containsAll, equals, hashCode, isEmpty, retainAll, toArray, toArray
 
Methods inherited from interface java.util.Set
containsAll, isEmpty, retainAll, toArray, toArray
 

Constructor Detail

LazyReferenceSet

public LazyReferenceSet(InternalCompassSession session,
                        int size,
                        AbstractCollectionMapping.CollectionType collectionType)
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

iterator

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

size

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

add

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

remove

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

removeAll

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

contains

public boolean contains(Object o)
Specified by:
contains in interface Collection
Specified by:
contains in interface Set
Overrides:
contains 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

clear

public void clear()
Specified by:
clear in interface Collection
Specified by:
clear in interface Set
Overrides:
clear 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-2009 The Compass Project.