org.neodatis.odb.impl.core.query.list.objects
Class LazySimpleListFromOid<T>

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList<E>
              extended by org.neodatis.tool.wrappers.list.OdbArrayList<T>
                  extended by org.neodatis.odb.impl.core.query.list.objects.LazySimpleListFromOid<T>
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<T>, java.util.Collection<T>, java.util.List<T>, java.util.RandomAccess, Objects<T>, IOdbList<T>

public class LazySimpleListFromOid<T>
extends OdbArrayList<T>
implements Objects<T>

A simple list to hold query result. It is used when no index and no order by is used and inMemory = false This collection does not store the objects, it only holds the OIDs of the objects. When user ask an object the object is lazy loaded by the getObjectFromId method

Author:
osmadja
See Also:
Serialized Form

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
LazySimpleListFromOid(int size, IStorageEngine engine, boolean returnObjects)
           
 
Method Summary
 boolean addWithKey(int key, T object)
          Add an object into the collection using a specific ordering key
 boolean addWithKey(OdbComparable key, T object)
          Add an object into the collection using a specific ordering key
 T get(int index)
           
 T getFirst()
          Return the first object of the collection, if exist
 boolean hasNext()
          Inform if the internal Iterator has more objects
 java.util.Iterator<T> iterator(OrderByConstants orderByType)
          Returns the collection iterator throughout the order by OrderByConstants
 T next()
          Returns the next object of the internal iterator of the collection
 boolean removeByKey(OdbComparable key, java.lang.Object value)
          Removes an object by its key
 void reset()
          Reset the internal iterator of the collection
 
Methods inherited from class org.neodatis.tool.wrappers.list.OdbArrayList
addAll, removeAll, set
 
Methods inherited from class java.util.ArrayList
add, add, addAll, clear, clone, contains, ensureCapacity, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, retainAll, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 
Methods inherited from interface org.neodatis.tool.wrappers.list.IOdbList
add, isEmpty
 
Methods inherited from interface java.util.List
add, addAll, clear, contains, containsAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, remove, retainAll, size, subList, toArray, toArray
 

Constructor Detail

LazySimpleListFromOid

public LazySimpleListFromOid(int size,
                             IStorageEngine engine,
                             boolean returnObjects)
Method Detail

addWithKey

public boolean addWithKey(OdbComparable key,
                          T object)
Description copied from interface: Objects
Add an object into the collection using a specific ordering key

Specified by:
addWithKey in interface Objects<T>
Returns:

addWithKey

public boolean addWithKey(int key,
                          T object)
Description copied from interface: Objects
Add an object into the collection using a specific ordering key

Specified by:
addWithKey in interface Objects<T>
Returns:

getFirst

public T getFirst()
Description copied from interface: Objects
Return the first object of the collection, if exist

Specified by:
getFirst in interface Objects<T>
Returns:

get

public T get(int index)
Specified by:
get in interface java.util.List<T>
Specified by:
get in interface IOdbList<T>
Overrides:
get in class OdbArrayList<T>

hasNext

public boolean hasNext()
Description copied from interface: Objects
Inform if the internal Iterator has more objects

Specified by:
hasNext in interface Objects<T>
Returns:

iterator

public java.util.Iterator<T> iterator(OrderByConstants orderByType)
Description copied from interface: Objects
Returns the collection iterator throughout the order by OrderByConstants

Specified by:
iterator in interface Objects<T>
Returns:

next

public T next()
Description copied from interface: Objects
Returns the next object of the internal iterator of the collection

Specified by:
next in interface Objects<T>
Returns:

reset

public void reset()
Description copied from interface: Objects
Reset the internal iterator of the collection

Specified by:
reset in interface Objects<T>

removeByKey

public boolean removeByKey(OdbComparable key,
                           java.lang.Object value)
Description copied from interface: Objects
Removes an object by its key

Specified by:
removeByKey in interface Objects<T>
value - The object to be removed
Returns:
true if object has been removed