1
2
3
4
5
6 package nl.javel.gisbeans.io;
7
8 import java.awt.geom.Rectangle2D;
9 import java.io.IOException;
10 import java.net.URL;
11 import java.util.List;
12
13 import nl.javel.gisbeans.geom.GisObject;
14
15 /***
16 * @author <a href="mailto:peter.jacobs@javel.nl">Peter Jacobs </a> <br>
17 * <a href="mailto:paul.jacobs@javel.nl">Paul Jacobs </a>
18 * @since JDK 1.2
19 * @version 1.0
20 */
21 public interface DataSourceInterface extends java.io.Serializable
22 {
23 /***
24 * returns the columnNames of the attribute data
25 *
26 * @return String[]
27 */
28 String[] getColumnNames();
29
30 /***
31 * returns the attribute data
32 *
33 * @return the attributes
34 * @throws IOException on IOException
35 */
36 String[][] getAttributes() throws IOException;
37
38 /***
39 * returns the URL of the datasource
40 *
41 * @return URL the URL of the file
42 */
43 URL getDataSource();
44
45 /***
46 * returns the number of shapes of the particular datasource
47 *
48 * @return int the number of shapes
49 * @throws IOException possible file IO or database connection failures.
50 */
51 int getNumShapes() throws IOException;
52
53 /***
54 * returns a GisObject
55 *
56 * @param index the number of the shape to be returned
57 * @return GisObject returns a <code>nl.javel.gisbeans.geom.GisObject</code>
58 * @throws IndexOutOfBoundsException whenever index>numShapes
59 * @throws IOException on IOFailure
60 */
61 GisObject getShape(int index) throws IOException, IndexOutOfBoundsException;
62
63 /***
64 * returns all the shapes of the particular datasource
65 *
66 * @return List the resulting ArrayList of
67 * <code>nl.javel.gisbeans.geom.GisObject</code>
68 * @throws IOException on IOFailure
69 */
70 List getShapes() throws IOException;
71
72 /***
73 * returns the shapes of the particular datasource in a particular extent
74 *
75 * @param rectangle the extent of the box (in geo-coordinates)
76 * @return List the resulting ArrayList of
77 * <code>nl.javel.gisbeans.geom.GisObject</code>
78 * @throws IOException on IOFailure
79 */
80 List getShapes(Rectangle2D rectangle) throws IOException;
81
82 /***
83 * returns the shapes based on a particular value of the attributes
84 *
85 * @param attribute the value of the attribute
86 * @param columnName the columnName
87 * @return List the resulting ArrayList of
88 * <code>nl.javel.gisbeans.geom.GisObject</code>
89 * @throws IOException on IOFailure
90 */
91 List getShapes(String attribute, String columnName) throws IOException;
92
93 /***
94 * @return returns the type of this dataSouce
95 * @throws IOException on IOFailure
96 */
97 int getType() throws IOException;
98 }