root / org.gvsig.toolbox / trunk / org.gvsig.toolbox / org.gvsig.toolbox.core / src / main / java / es / unex / sextante / dataObjects / ITable.java @ 341
History | View | Annotate | Download (2.71 KB)
1 |
package es.unex.sextante.dataObjects; |
---|---|
2 |
|
3 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
4 |
|
5 |
/**
|
6 |
* This is the base interface that all table objects have to implement to be able to be used by SEXTANTE algorithms.
|
7 |
*
|
8 |
* Instead of implementing this class directly, it is recommended to extend {@link AbstractTable}
|
9 |
*
|
10 |
* @author Victor Olaya. volaya@unex.es
|
11 |
*
|
12 |
*/
|
13 |
public interface ITable |
14 |
extends
|
15 |
IDataObject { |
16 |
|
17 |
/**
|
18 |
* Creates a new table
|
19 |
*
|
20 |
* @param sName
|
21 |
* The name of the table
|
22 |
* @param sFilename
|
23 |
* The filename associated with the table
|
24 |
* @param types
|
25 |
* an array with attributes data types
|
26 |
* @param sFields
|
27 |
* an array with attributes names
|
28 |
*/
|
29 |
// public void create(String sName,
|
30 |
// String sFilename,
|
31 |
// Class[] types,
|
32 |
// String[] sFields);
|
33 |
/**
|
34 |
* adds a new record to the table
|
35 |
*
|
36 |
* @param attributes
|
37 |
* the values of the record
|
38 |
*/
|
39 |
public void addRecord(Object[] attributes); |
40 |
|
41 |
|
42 |
/**
|
43 |
* Returns an iterator to iterate the table
|
44 |
*
|
45 |
* @return an iterator to iterate the table
|
46 |
*/
|
47 |
public IRecordsetIterator iterator();
|
48 |
|
49 |
|
50 |
/**
|
51 |
* Returns the name of a field
|
52 |
*
|
53 |
* @param i
|
54 |
* the field. zero-based
|
55 |
* @return The name of the specified field
|
56 |
*/
|
57 |
public String getFieldName(int i); |
58 |
|
59 |
|
60 |
/**
|
61 |
* Returns the data type of a field
|
62 |
*
|
63 |
* @param i
|
64 |
* the field. zero-based
|
65 |
* @return The data type of the specified field
|
66 |
*/
|
67 |
public Class getFieldType(int i); |
68 |
|
69 |
|
70 |
/**
|
71 |
* Returns the total number of fields
|
72 |
*
|
73 |
* @return the total number of fields
|
74 |
*/
|
75 |
public int getFieldCount(); |
76 |
|
77 |
|
78 |
/**
|
79 |
* Returns an array with data types of all the fields in the table
|
80 |
*
|
81 |
* @return an array with data types of all the fields in the table
|
82 |
*/
|
83 |
public Class[] getFieldTypes(); |
84 |
|
85 |
|
86 |
/**
|
87 |
* Returns an array with the names of all the fields in the table
|
88 |
*
|
89 |
* @return an array with the names of all the fields in the table
|
90 |
*/
|
91 |
public String[] getFieldNames(); |
92 |
|
93 |
|
94 |
/**
|
95 |
* Returns the total number of records(rows) in the table
|
96 |
*
|
97 |
* @return the total number of records(rows) in the table
|
98 |
*/
|
99 |
public long getRecordCount(); |
100 |
|
101 |
|
102 |
/**
|
103 |
* Returns the index of a field from its name. Returns -1 if there is not a field with that name.
|
104 |
*
|
105 |
* @param fieldName
|
106 |
* the name of the field
|
107 |
* @return the index of the given field
|
108 |
*/
|
109 |
public int getFieldIndexByName(String fieldName); |
110 |
|
111 |
public FeatureStore getFeatureStore();
|
112 |
} |