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 booleancontains(java.lang.Object obj)ExtObjectSetext()Returns an ObjectSet with extended functionality.java.lang.Objectget(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.booleanhasNext()Returns true if the ObjectSet has more elements.intindexOf(java.lang.Object obj)java.util.Iteratoriterator()intlastIndexOf(java.lang.Object obj)java.lang.Objectnext()Returns the next object in the ObjectSet.voidremove()voidreset()Resets the ObjectSet cursor before the first element.intsize()Returns the number of elements in the ObjectSet.voidskip(int count)skips the specified number of objects without activating them.voidsort(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:ExtObjectSetskips 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:
skipin interfaceExtObjectSet
-
iterator
public java.util.Iterator iterator()
- Specified by:
iteratorin interfacejava.util.Collection- Specified by:
iteratorin interfacejava.lang.Iterable- Specified by:
iteratorin interfacejava.util.List- Overrides:
iteratorin classjava.util.AbstractList
-
getIDs
public long[] getIDs()
Description copied from interface:ExtObjectSetreturns an array of internal IDs that correspond to the contained objects.- Specified by:
getIDsin interfaceExtObjectSet- See Also:
ExtObjectContainer.getID(java.lang.Object),ExtObjectContainer.getByID(long)
-
ext
public ExtObjectSet ext()
Description copied from interface:ObjectSetReturns 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:ObjectSetReturns true if the ObjectSet has more elements.
-
next
public java.lang.Object next()
Description copied from interface:ObjectSetReturns the next object in the ObjectSet.
Before returning the object, next() triggers automatic activation of the object with the respectiveglobalorclass specificsetting.
-
reset
public void reset()
Description copied from interface:ObjectSetResets 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:ObjectSetReturns the number of elements in the ObjectSet.
-
contains
public boolean contains(java.lang.Object obj)
- Specified by:
containsin interfacejava.util.Collection- Specified by:
containsin interfacejava.util.List- Overrides:
containsin classjava.util.AbstractCollection
-
get
public java.lang.Object get(int index)
Description copied from interface:ExtObjectSetreturns the item at position [index] in this ObjectSet.
The object will be activated.- Specified by:
getin interfaceExtObjectSet- Specified by:
getin interfacejava.util.List- Specified by:
getin 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:
indexOfin interfacejava.util.List- Overrides:
indexOfin classjava.util.AbstractList
-
lastIndexOf
public int lastIndexOf(java.lang.Object obj)
- Specified by:
lastIndexOfin interfacejava.util.List- Overrides:
lastIndexOfin classjava.util.AbstractList
-
remove
public void remove()
-
-