Package com.db4o.internal.query
Class ObjectSetFacade
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList
-
- com.db4o.internal.query.ObjectSetFacade
-
- All Implemented Interfaces:
ExtObjectSet
,ObjectSet
,java.lang.Iterable
,java.util.Collection
,java.util.List
public class ObjectSetFacade extends java.util.AbstractList implements ExtObjectSet
-
-
Field Summary
Fields Modifier and Type Field Description StatefulQueryResult
_delegate
-
Constructor Summary
Constructors Constructor Description ObjectSetFacade(QueryResult queryResult)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(java.lang.Object obj)
ExtObjectSet
ext()
Returns an ObjectSet with extended functionality.java.lang.Object
get(int index)
returns the item at position [index] in this ObjectSet.long[]
getIDs()
returns an array of internal IDs that correspond to the contained objects.boolean
hasNext()
Returns true if the ObjectSet has more elements.int
indexOf(java.lang.Object obj)
java.util.Iterator
iterator()
int
lastIndexOf(java.lang.Object obj)
java.lang.Object
next()
Returns the next object in the ObjectSet.void
remove()
void
reset()
Resets the ObjectSet cursor before the first element.int
size()
Returns the number of elements in the ObjectSet.void
skip(int count)
skips the specified number of objects without activating them.void
sort(QueryComparator cmp)
-
Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, listIterator, listIterator, remove, removeRange, set, subList
-
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
-
-
-
-
Field Detail
-
_delegate
public final StatefulQueryResult _delegate
-
-
Constructor Detail
-
ObjectSetFacade
public ObjectSetFacade(QueryResult queryResult)
-
-
Method Detail
-
sort
public void sort(QueryComparator cmp)
-
skip
public void skip(int count)
Description copied from interface:ExtObjectSet
skips the specified number of objects without activating them. Call this method before starting iterating over the iterator returned byList.iterator()
. This method has no effect on calls toExtObjectSet.get(int)
- Specified by:
skip
in interfaceExtObjectSet
-
iterator
public java.util.Iterator iterator()
- Specified by:
iterator
in interfacejava.util.Collection
- Specified by:
iterator
in interfacejava.lang.Iterable
- Specified by:
iterator
in interfacejava.util.List
- Overrides:
iterator
in classjava.util.AbstractList
-
getIDs
public long[] getIDs()
Description copied from interface:ExtObjectSet
returns an array of internal IDs that correspond to the contained objects.- Specified by:
getIDs
in interfaceExtObjectSet
- See Also:
ExtObjectContainer.getID(java.lang.Object)
,ExtObjectContainer.getByID(long)
-
ext
public ExtObjectSet ext()
Description copied from interface:ObjectSet
Returns an ObjectSet with extended functionality.
Every ObjectSet that db4o provides can be casted to an ExtObjectSet. This method is supplied for your convenience to work without a cast.
The ObjectSet functionality is split to two interfaces to allow newcomers to focus on the essential methods.
-
hasNext
public boolean hasNext()
Description copied from interface:ObjectSet
Returns true if the ObjectSet has more elements.
-
next
public java.lang.Object next()
Description copied from interface:ObjectSet
Returns the next object in the ObjectSet.
Before returning the object, next() triggers automatic activation of the object with the respectiveglobal
orclass specific
setting.
-
reset
public void reset()
Description copied from interface:ObjectSet
Resets the ObjectSet cursor before the first element. A subsequent call toObjectSet.next()
will return the first element.
-
size
public int size()
Description copied from interface:ObjectSet
Returns the number of elements in the ObjectSet.
-
contains
public boolean contains(java.lang.Object obj)
- Specified by:
contains
in interfacejava.util.Collection
- Specified by:
contains
in interfacejava.util.List
- Overrides:
contains
in classjava.util.AbstractCollection
-
get
public java.lang.Object get(int index)
Description copied from interface:ExtObjectSet
returns the item at position [index] in this ObjectSet.
The object will be activated.- Specified by:
get
in interfaceExtObjectSet
- Specified by:
get
in interfacejava.util.List
- Specified by:
get
in classjava.util.AbstractList
- Parameters:
index
- the index position in this ObjectSet.- Returns:
- the activated object.
-
indexOf
public int indexOf(java.lang.Object obj)
- Specified by:
indexOf
in interfacejava.util.List
- Overrides:
indexOf
in classjava.util.AbstractList
-
lastIndexOf
public int lastIndexOf(java.lang.Object obj)
- Specified by:
lastIndexOf
in interfacejava.util.List
- Overrides:
lastIndexOf
in classjava.util.AbstractList
-
remove
public void remove()
-
-