Package com.db4o
Interface ObjectSet<T>
-
- All Superinterfaces:
java.util.Collection<T>
,java.lang.Iterable<T>
,java.util.List<T>
- All Known Subinterfaces:
ExtObjectSet
- All Known Implementing Classes:
ObjectSetFacade
public interface ObjectSet<T> extends java.util.List<T>, java.lang.Iterable<T>
An ObjectSet is a representation for a set of objects returned by a query.
ObjectSet extends the list interface. It is recommended to never reference ObjectSet directly in code but to use the list interface instead.
Note that the underlyingObjectContainer
of an ObjectSet needs to remain open as long as an ObjectSet is used. This is necessary for lazy instantiation. The objects in an ObjectSet are only instantiated when they are actually being used by the application. In case you want to use a query result after the object container has been closed, you need to copy the result set.- See Also:
for extended functionality.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ExtObjectSet
ext()
Returns an ObjectSet with extended functionality.boolean
hasNext()
Returns true if the ObjectSet has more elements.T
next()
Returns the next object in the ObjectSet.void
reset()
Resets the ObjectSet cursor before the first element.int
size()
Returns the number of elements in the ObjectSet.
-
-
-
Method Detail
-
ext
ExtObjectSet ext()
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
boolean hasNext()
Returns true if the ObjectSet has more elements.- Returns:
- boolean - true if the ObjectSet has more elements.
-
next
T next()
Returns the next object in the ObjectSet.
Before returning the object, next() triggers automatic activation of the object with the respectiveglobal
orclass specific
setting.- Returns:
- the next object in the ObjectSet.
-
reset
void reset()
Resets the ObjectSet cursor before the first element. A subsequent call tonext()
will return the first element.
-
-