01: /*
02: * Copyright (C) 1999-2004 <A href="http://www-ist.massey.ac.nz/JBDietrich" target="_top">Jens Dietrich</a>
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */
18: package org.mandarax.util;
19:
20: import org.mandarax.kernel.Clause;
21: import org.mandarax.kernel.ClauseSetException;
22:
23: /**
24: * Iterator for clauses. The iterator provides a simple mean for
25: * iterating but avoiding casting as it is the case when using
26: * the <code>java.util.Enumeration</code> or <code>java.util.Iterator</code>
27: * interface. But both interfaces are also supported (i.e., extended).
28: * @author <A href="http://www-ist.massey.ac.nz/JBDietrich" target="_top">Jens Dietrich</A>
29: * @version 3.4 <7 March 05>
30: * @since 1.0
31: */
32: public interface ClauseIterator extends java.util.Enumeration,
33: java.util.Iterator {
34:
35: /**
36: * Indicates whether there are more clauses.
37: * @return true if there are more clauses, false otherwise
38: * @throws ClauseSetException
39: */
40: boolean hasMoreClauses() throws ClauseSetException;
41:
42: /**
43: * Get the next clause.
44: * @return the next clause
45: * @throws ClauseSetException
46: */
47: Clause nextClause() throws ClauseSetException;
48:
49: /**
50: * Close the iterator and release all resources.
51: * New in 2.0 - the main motivation is to have a method
52: * to release jdbc connections and other external resources.
53: */
54: void close();
55: }
|