svn-gvsig-desktop / tags / v1_0_1_RELEASE / applications / appgvSIG / src / com / iver / cit / gvsig / gui / filter / DefaultExpressionDataSource.java @ 9531
History | View | Annotate | Download (3.19 KB)
1 |
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
|
---|---|
2 |
*
|
3 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana.
|
4 |
*
|
5 |
* This program is free software; you can redistribute it and/or
|
6 |
* modify it under the terms of the GNU General Public License
|
7 |
* as published by the Free Software Foundation; either version 2
|
8 |
* of the License, or (at your option) any later version.
|
9 |
*
|
10 |
* This program is distributed in the hope that it will be useful,
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
13 |
* GNU General Public License for more details.
|
14 |
*
|
15 |
* You should have received a copy of the GNU General Public License
|
16 |
* along with this program; if not, write to the Free Software
|
17 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
18 |
*
|
19 |
* For more information, contact:
|
20 |
*
|
21 |
* Generalitat Valenciana
|
22 |
* Conselleria d'Infraestructures i Transport
|
23 |
* Av. Blasco Ib??ez, 50
|
24 |
* 46010 VALENCIA
|
25 |
* SPAIN
|
26 |
*
|
27 |
* +34 963862235
|
28 |
* gvsig@gva.es
|
29 |
* www.gvsig.gva.es
|
30 |
*
|
31 |
* or
|
32 |
*
|
33 |
* IVER T.I. S.A
|
34 |
* Salamanca 50
|
35 |
* 46005 Valencia
|
36 |
* Spain
|
37 |
*
|
38 |
* +34 963163400
|
39 |
* dac@iver.es
|
40 |
*/
|
41 |
package com.iver.cit.gvsig.gui.filter; |
42 |
|
43 |
import com.hardcode.gdbms.engine.data.driver.DriverException; |
44 |
import com.hardcode.gdbms.engine.values.Value; |
45 |
import com.iver.cit.gvsig.fmap.layers.SelectableDataSource; |
46 |
|
47 |
|
48 |
/**
|
49 |
* DOCUMENT ME!
|
50 |
*
|
51 |
* @author Fernando Gonz?lez Cort?s
|
52 |
*/
|
53 |
public class DefaultExpressionDataSource implements ExpressionDataSource { |
54 |
private SelectableDataSource tabla = null; |
55 |
|
56 |
/**
|
57 |
* DOCUMENT ME!
|
58 |
*
|
59 |
* @param table DOCUMENT ME!
|
60 |
*/
|
61 |
public void setTable(SelectableDataSource table) { |
62 |
this.tabla = table;
|
63 |
} |
64 |
public void start() throws DriverException |
65 |
{ |
66 |
tabla.start(); |
67 |
} |
68 |
public void stop() throws DriverException |
69 |
{ |
70 |
tabla.stop(); |
71 |
} |
72 |
|
73 |
/**
|
74 |
* DOCUMENT ME!
|
75 |
*
|
76 |
* @param idField
|
77 |
*
|
78 |
* @return
|
79 |
* @throws FilterException
|
80 |
*/
|
81 |
public String getFieldName(int idField) throws FilterException { |
82 |
try {
|
83 |
return tabla.getFieldName(idField);
|
84 |
} catch (DriverException e) {
|
85 |
throw new FilterException(e); |
86 |
} |
87 |
} |
88 |
|
89 |
/**
|
90 |
* DOCUMENT ME!
|
91 |
*
|
92 |
* @return
|
93 |
* @throws FilterException
|
94 |
*/
|
95 |
public int getFieldCount() throws FilterException { |
96 |
try {
|
97 |
return tabla.getFieldCount();
|
98 |
} catch (DriverException e) {
|
99 |
throw new FilterException(e); |
100 |
} |
101 |
} |
102 |
|
103 |
/**
|
104 |
* DOCUMENT ME!
|
105 |
*
|
106 |
* @param field
|
107 |
*
|
108 |
* @return
|
109 |
* @throws FilterException
|
110 |
*/
|
111 |
public Value getFieldValue(int row, int field) throws FilterException { |
112 |
try {
|
113 |
return tabla.getFieldValue((long) row, field); |
114 |
} catch (DriverException e) {
|
115 |
throw new FilterException(e); |
116 |
} |
117 |
} |
118 |
|
119 |
/**
|
120 |
* @see com.iver.cit.gvsig.gui.filter.ExpressionDataSource#getRowCount()
|
121 |
*/
|
122 |
public int getRowCount() throws FilterException { |
123 |
try {
|
124 |
return (int) tabla.getRowCount(); |
125 |
} catch (DriverException e) {
|
126 |
throw new FilterException(e); |
127 |
} |
128 |
} |
129 |
|
130 |
/**
|
131 |
* @see com.iver.cit.gvsig.gui.filter.ExpressionDataSource#getDataSourceName()
|
132 |
*/
|
133 |
public String getDataSourceName() { |
134 |
return tabla.getName();
|
135 |
} |
136 |
} |