db4o 7.4

com.db4o
Interface ObjectSet<Item>

All Superinterfaces:
java.util.Collection<Item>, java.lang.Iterable<Item>, java.util.Iterator<Item>, java.util.List<Item>
All Known Subinterfaces:
ExtObjectSet

public interface ObjectSet<Item>
extends java.util.List<Item>, java.util.Iterator<Item>

query resultset.

An ObjectSet is a representation for a set of objects returned by a query.

ObjectSet extends the system collection interfaces java.util.List/System.Collections.IList where they are available. It is recommended, never to reference ObjectSet directly in code but to use List / IList instead.

Note that the underlying ObjectContainer 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.

See Also:
for extended functionality.

Method Summary
 ExtObjectSet ext()
          returns an ObjectSet with extended functionality.
 boolean hasNext()
          returns true if the ObjectSet has more elements.
 Item 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.
 
Methods inherited from interface java.util.List
add, add, addAll, addAll, clear, contains, containsAll, equals, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, retainAll, set, subList, toArray, toArray
 
Methods inherited from interface java.util.Iterator
remove
 

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.

Specified by:
hasNext in interface java.util.Iterator<Item>
Returns:
boolean - true if the ObjectSet has more elements.

next

Item 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.

Specified by:
next in interface java.util.Iterator<Item>
Returns:
the next object in the ObjectSet.

reset

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

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


size

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

Specified by:
size in interface java.util.Collection<Item>
Specified by:
size in interface java.util.List<Item>
Returns:
the number of elements in the ObjectSet.

db4o 7.4

Copyright 2007 db4objects Inc. All rights reserved.