root / trunk / applications / appgvSIG / src / com / iver / cit / gvsig / gui / filter / DefaultExpressionDataSource.java @ 884
History | View | Annotate | Download (1.88 KB)
1 |
package com.iver.cit.gvsig.gui.filter; |
---|---|
2 |
|
3 |
import com.hardcode.gdbms.engine.data.DataSource; |
4 |
import com.hardcode.gdbms.engine.data.DriverException; |
5 |
import com.hardcode.gdbms.engine.values.Value; |
6 |
import com.iver.cit.gvsig.fmap.layers.SelectableDataSource; |
7 |
|
8 |
|
9 |
/**
|
10 |
* DOCUMENT ME!
|
11 |
*
|
12 |
* @author Fernando Gonz?lez Cort?s
|
13 |
*/
|
14 |
public class DefaultExpressionDataSource implements ExpressionDataSource { |
15 |
private SelectableDataSource tabla = null; |
16 |
|
17 |
/**
|
18 |
* DOCUMENT ME!
|
19 |
*
|
20 |
* @param table DOCUMENT ME!
|
21 |
*/
|
22 |
public void setTable(SelectableDataSource table) { |
23 |
this.tabla = table;
|
24 |
} |
25 |
|
26 |
/**
|
27 |
* DOCUMENT ME!
|
28 |
*
|
29 |
* @param idField
|
30 |
*
|
31 |
* @return
|
32 |
* @throws FilterException
|
33 |
*/
|
34 |
public String getFieldName(int idField) throws FilterException { |
35 |
try {
|
36 |
return tabla.getFieldName(idField);
|
37 |
} catch (DriverException e) {
|
38 |
throw new FilterException(e); |
39 |
} |
40 |
} |
41 |
|
42 |
/**
|
43 |
* DOCUMENT ME!
|
44 |
*
|
45 |
* @return
|
46 |
* @throws FilterException
|
47 |
*/
|
48 |
public int getFieldCount() throws FilterException { |
49 |
try {
|
50 |
return tabla.getFieldCount();
|
51 |
} catch (DriverException e) {
|
52 |
throw new FilterException(e); |
53 |
} |
54 |
} |
55 |
|
56 |
/**
|
57 |
* DOCUMENT ME!
|
58 |
*
|
59 |
* @param field
|
60 |
*
|
61 |
* @return
|
62 |
* @throws FilterException
|
63 |
*/
|
64 |
public Value getFieldValue(int row, int field) throws FilterException { |
65 |
try {
|
66 |
return tabla.getFieldValue((long) row, field); |
67 |
} catch (DriverException e) {
|
68 |
throw new FilterException(e); |
69 |
} |
70 |
} |
71 |
|
72 |
/**
|
73 |
* @see com.iver.cit.gvsig.gui.filter.ExpressionDataSource#getRowCount()
|
74 |
*/
|
75 |
public int getRowCount() throws FilterException { |
76 |
try {
|
77 |
return (int) tabla.getRowCount(); |
78 |
} catch (DriverException e) {
|
79 |
throw new FilterException(e); |
80 |
} |
81 |
} |
82 |
|
83 |
/**
|
84 |
* @see com.iver.cit.gvsig.gui.filter.ExpressionDataSource#getDataSourceName()
|
85 |
*/
|
86 |
public String getDataSourceName() { |
87 |
return tabla.getName();
|
88 |
} |
89 |
} |