com.db4o.ObjectSet Maven / Gradle / Ivy
The newest version!
/* Copyright (C) 2004 - 2005 db4objects Inc. http://www.db4o.com
This file is part of the db4o open source object database.
db4o is free software; you can redistribute it and/or modify it under
the terms of version 2 of the GNU General Public License as published
by the Free Software Foundation and as clarified by db4objects' GPL
interpretation policy, available at
http://www.db4o.com/about/company/legalpolicies/gplinterpretation/
Alternatively you can write to db4objects, Inc., 1900 S Norfolk Street,
Suite 350, San Mateo, CA 94403, USA.
db4o is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
package com.db4o;
import com.db4o.ext.*;
/**
* 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
* {@link ObjectContainer 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 ExtObjectSet for extended functionality.
*
*/
public 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.
*/
public ExtObjectSet ext();
/**
* returns true
if the ObjectSet
has more elements.
*
* @return boolean - true
if the ObjectSet
has more
* elements.
*/
public boolean hasNext ();
/**
* returns the next object in the ObjectSet
.
*
* Before returning the Object, next() triggers automatic activation of the
* Object with the respective
* {@link com.db4o.config.Configuration#activationDepth global} or
* {@link com.db4o.config.ObjectClass#maximumActivationDepth class specific}
* setting.
* @return the next object in the ObjectSet
.
*/
public Object next ();
/**
* resets the ObjectSet
cursor before the first element.
*
A subsequent call to next()
will return the first element.
*/
public void reset ();
/**
* returns the number of elements in the ObjectSet
.
* @return the number of elements in the ObjectSet
.
*/
public int size ();
}