svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libFMap_data / src / org / gvsig / fmap / data / DataQuery.java @ 23893
History | View | Annotate | Download (2.8 KB)
1 | 23764 | cordinyana | /* gvSIG. Geographic Information System of the Valencian Government
|
---|---|---|---|
2 | *
|
||
3 | * Copyright (C) 2007-2008 Infrastructures and Transports Department
|
||
4 | * of the Valencian Gobernment (CIT)
|
||
5 | *
|
||
6 | * This program is free software; you can redistribute it and/or
|
||
7 | * modify it under the terms of the GNU General Public License
|
||
8 | * as published by the Free Software Foundation; either version 2
|
||
9 | * of the License, or (at your option) any later version.
|
||
10 | *
|
||
11 | * This program 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
|
||
14 | * GNU General Public License for more details.
|
||
15 | *
|
||
16 | * You should have received a copy of the GNU General Public License
|
||
17 | * along with this program; if not, write to the Free Software
|
||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||
19 | * MA 02110-1301, USA.
|
||
20 | *
|
||
21 | */
|
||
22 | |||
23 | /*
|
||
24 | * AUTHORS (In addition to CIT):
|
||
25 | * 2008 {DiSiD Technologies} {Create Parameter object to define queries}
|
||
26 | */
|
||
27 | 23457 | cordinyana | package org.gvsig.fmap.data; |
28 | |||
29 | import java.util.HashMap; |
||
30 | import java.util.Map; |
||
31 | |||
32 | 23764 | cordinyana | /**
|
33 | * Defines the properties of a collection of data, as a result of a query
|
||
34 | * through a DataStore.
|
||
35 | * <p>
|
||
36 | * The scala parameter can be used by the DataStore as a hint about the quality
|
||
37 | * or resolution of the data needed to view or operate with the data returned.
|
||
38 | * As an example, it may use the scala to return only a representative subset of
|
||
39 | * the data, or maybe to return Data with less detail, like a point or a line
|
||
40 | * instead of a polygon.
|
||
41 | * </p>
|
||
42 | *
|
||
43 | * @author <a href="mailto:cordin@disid.com">C?sar Ordi?ana</a>
|
||
44 | */
|
||
45 | 23457 | cordinyana | public class DataQuery { |
46 | |||
47 | private double scale; |
||
48 | |||
49 | private Map attributes = new HashMap(); |
||
50 | |||
51 | 23764 | cordinyana | /**
|
52 | * Empty constructor.
|
||
53 | */
|
||
54 | 23457 | cordinyana | public DataQuery() {
|
55 | super();
|
||
56 | } |
||
57 | |||
58 | 23764 | cordinyana | /**
|
59 | * Constructor with an scale.
|
||
60 | *
|
||
61 | * @param scale
|
||
62 | * the scale for the data
|
||
63 | */
|
||
64 | 23457 | cordinyana | public DataQuery(double scale) { |
65 | super();
|
||
66 | this.scale = scale;
|
||
67 | } |
||
68 | |||
69 | /**
|
||
70 | 23764 | cordinyana | * Returns the scale.
|
71 | *
|
||
72 | 23457 | cordinyana | * @return the scale
|
73 | */
|
||
74 | public double getScale() { |
||
75 | return scale;
|
||
76 | } |
||
77 | |||
78 | /**
|
||
79 | 23764 | cordinyana | * Sets the scale.
|
80 | *
|
||
81 | 23457 | cordinyana | * @param scale
|
82 | * the scale to set
|
||
83 | */
|
||
84 | public void setScale(double scale) { |
||
85 | this.scale = scale;
|
||
86 | } |
||
87 | |||
88 | /**
|
||
89 | * Returns the value of an attribute.
|
||
90 | *
|
||
91 | * @param name
|
||
92 | * of the attribute
|
||
93 | * @return the attribute value
|
||
94 | */
|
||
95 | public Object getAttribute(String name) { |
||
96 | return attributes.get(name);
|
||
97 | } |
||
98 | |||
99 | /**
|
||
100 | * Sets the value of an attribute.
|
||
101 | *
|
||
102 | * @param name
|
||
103 | * of the attribute
|
||
104 | * @param value
|
||
105 | * for the attribute
|
||
106 | */
|
||
107 | public void setAttribute(String name, Object value) { |
||
108 | attributes.put(name, value); |
||
109 | } |
||
110 | |||
111 | } |