01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2002-2006, GeoTools Project Managment Committee (PMC)
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation;
09: * version 2.1 of the License.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: */
16: package org.geotools.feature;
17:
18: /**
19: * A drop in replacement for Iterator that does not require casting for Java 1.4 code.
20: * <p>
21: * We are sorry but this does not implement Iteartor<Feature>, although it should
22: * be a drop in replacement when Geotools is able to upgrade to Java 5.
23: * </p>
24: * @author Ian Schneider
25: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/api/src/main/java/org/geotools/feature/FeatureIterator.java $
26: */
27: public interface FeatureIterator {
28: /**
29: * Does another Feature exist in this Iteration.
30: * <p>
31: * Iterator defin: Returns true if the iteration has more elements. (In other words, returns true if next would return an element rather than throwing an exception.)
32: * </p>
33: * @return true if more Features exist, false otherwise.
34: */
35: public boolean hasNext();
36:
37: /**
38: * Get the next Feature in this iteration.
39: *
40: * @return The next Feature
41: *
42: * @throws java.util.NoSuchElementException If no more Features exist.
43: */
44: public Feature next() throws java.util.NoSuchElementException;
45:
46: /**
47: * Required so FeatureCollection classes can implement close( FeatureIterator ).
48: */
49: public void close();
50: }
|