01: /*
02: * GeoTools - OpenSource mapping toolkit
03: * http://geotools.org
04: * (C) 2003-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.data;
17:
18: import java.io.IOException;
19:
20: /**
21: * FeatureReader customized for FeatureID handling.
22: *
23: * <p>
24: * An experimental method for doing FIDs. I'd like to see it and
25: * AttributeReader extend a similar base. Perhaps BaseReader or something?
26: * And perhaps have FeatureReader extend it too? This reader just returns an
27: * incrementing index. May be sufficient for files, representing rows in a
28: * file. For jdbc datasources another fid reader should be used.
29: * </p>
30: *
31: * <p>
32: * We could have FIDReader implement AttributeReader, but it doesn't seem to
33: * make sense, as the getAttributeType doesn't make much sense, as our
34: * featureID is just a string. Or we could consider having a special FID
35: * attribute in our hierarchy.
36: * </p>
37: *
38: * @author Chris Holmes
39: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/main/src/main/java/org/geotools/data/FIDReader.java $
40: * @version $Id: FIDReader.java 20651 2006-07-21 07:51:54Z jgarnett $
41: */
42: public interface FIDReader {
43: /**
44: * Release any resources associated with this reader
45: */
46: void close() throws IOException;
47:
48: /**
49: * Returns whether another fid exists for this reader.
50: *
51: * @return <code>true</code> if more content exists
52: */
53: boolean hasNext() throws IOException;
54:
55: /**
56: * Gets the next FID from the Reader.
57: *
58: * @return Next featureID
59: */
60: String next() throws IOException;
61: }
|