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: * The low-level attribute reading API. An AttributeReader is responsible for
22: * reading a finite set of attributes from an underlying storage format. It
23: * provides meta-data regarding the data it can provide, and an iterative,
24: * row-based approach for accessing the data.
25: *
26: * @author Ian Schneider
27: * @source $URL: http://svn.geotools.org/geotools/tags/2.4.1/modules/library/main/src/main/java/org/geotools/data/AttributeReader.java $
28: * @version $Id: AttributeReader.java 20651 2006-07-21 07:51:54Z jgarnett $
29: *
30: * @see AttributeAcceptor
31: */
32: public interface AttributeReader {
33: /**
34: * The number of attributes this reader can read, i.e the length of a row.
35: *
36: * @return Number of attribtues this reader can read
37: */
38: int getAttributeCount();
39:
40: /**
41: * Retrieve the AttributeType at the given index.
42: *
43: * @return AttributeType at given index
44: */
45: org.geotools.feature.AttributeType getAttributeType(int index)
46: throws ArrayIndexOutOfBoundsException;
47:
48: /**
49: * Release any resources associated with this reader
50: */
51: void close() throws IOException;
52:
53: /**
54: * Does another set of attributes exist in this reader?
55: *
56: * @return <code>true</code> if additional content exists for
57: * AttributeReader
58: */
59: boolean hasNext() throws IOException;
60:
61: /**
62: * Advance the reader to the next set of attributes.
63: */
64: void next() throws IOException;
65:
66: /**
67: * Read the attribute at the given index.
68: *
69: * @return Object Attribute at given index
70: */
71: Object read(int index) throws IOException,
72: ArrayIndexOutOfBoundsException;
73: }
|