01: /*
02: Copyright (C) 2007 Mobixess Inc. http://www.java-objects-database.com
03:
04: This file is part of the JODB (Java Objects Database) open source project.
05:
06: JODB is free software; you can redistribute it and/or modify it under
07: the terms of version 2 of the GNU General Public License as published
08: by the Free Software Foundation.
09:
10: JODB is distributed in the hope that it will be useful, but WITHOUT ANY
11: WARRANTY; without even the implied warranty of MERCHANTABILITY or
12: FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13: for more details.
14:
15: You should have received a copy of the GNU General Public License along
16: with this program; if not, write to the Free Software Foundation, Inc.,
17: 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18: */
19: package com.mobixess.jodb.soda.api;
20:
21: import java.util.Iterator;
22: import java.util.List;
23:
24: /**
25: * query resultset.
26: * <br><br>The <code>ObjectSet</code> interface serves as a cursor to
27: * iterate through a set of objects retrieved by a query.
28: */
29: public interface ObjectSet<Clazz> extends List<Clazz>, Iterator<Clazz> {
30:
31: /**
32: * returns <code>true</code> if the <code>ObjectSet</code> has more elements.
33: * @return boolean <code>true</code> if the <code>ObjectSet</code> has more
34: * elements.
35: */
36: public boolean hasNext();
37:
38: /**
39: * returns the next object in the <code>ObjectSet</code>.
40: * @return the next object in the <code>ObjectSet</code>.
41: */
42: public Clazz next();
43:
44: /**
45: * resets the <code>ObjectSet</code> cursor before the first element. <br><br>
46: * A subsequent call to <code>next()</code> will return the first element.
47: */
48: public void reset();
49:
50: /**
51: * returns the number of elements in the <code>ObjectSet</code>.
52: * @return the number of elements in the <code>ObjectSet</code>.
53: */
54: public int size();
55: }
|