db4o 2.0

com.db4o
Interface ObjectSet

All Known Subinterfaces:
ExtObjectSet

public interface ObjectSet

query resultset.

The ObjectSet class serves as a cursor to iterate through a set of objects retrieved by a call to ObjectContainer.get(template).

Note that the used ObjectContainer needs to remain opened during the use of an ObjectSet to allow lazy instantiation.

See Also:
ExtObjectSet for extended functionality.

Method Summary
 ExtObjectSet ext()
          returns an ObjectSet with extended functionality.
 boolean hasNext()
          returns true if the ObjectSet has more elements.
 java.lang.Object 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

public 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

public boolean hasNext()
returns true if the ObjectSet has more elements.
Returns:
boolean - true if the ObjectSet has more elements.

next

public java.lang.Object next()
returns the next object in the ObjectSet.

Before returning the Object, next() triggers automatic activation of the Object with the respective global or class specific setting.

Returns:
the next object in the ObjectSet.

reset

public void reset()
resets the ObjectSet cursor before the first element.

A subsequent call to next() will return the first element.

size

public int size()
returns the number of elements in the ObjectSet.
Returns:
the number of elements in the ObjectSet.

db4o 2.0