svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libFMap_dal / src / org / gvsig / fmap / dal / feature / FeatureIndex.java @ 33717
History | View | Annotate | Download (4.4 KB)
1 | 23867 | jiyarza | /* gvSIG. Geographic Information System of the Valencian Government
|
---|---|---|---|
2 | *
|
||
3 | * Copyright (C) 2007-2008 Infrastructures and Transports Department
|
||
4 | * of the Valencian Government (CIT)
|
||
5 | 24206 | jiyarza | *
|
6 | 23867 | jiyarza | * 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 | 24206 | jiyarza | *
|
11 | 23867 | jiyarza | * 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 | 24206 | jiyarza | *
|
16 | 23867 | jiyarza | * 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 | 24206 | jiyarza | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 | 23867 | jiyarza | * MA 02110-1301, USA.
|
20 | 24206 | jiyarza | *
|
21 | 23867 | jiyarza | */
|
22 | |||
23 | /*
|
||
24 | * AUTHORS (In addition to CIT):
|
||
25 | * 2008 {{Company}} {{Task}}
|
||
26 | */
|
||
27 | 24206 | jiyarza | |
28 | 23867 | jiyarza | |
29 | 24496 | jmvivo | package org.gvsig.fmap.dal.feature; |
30 | 23867 | jiyarza | |
31 | 24206 | jiyarza | import java.util.List; |
32 | |||
33 | 24505 | jmvivo | import org.gvsig.fmap.dal.exception.DataException; |
34 | import org.gvsig.fmap.dal.feature.exception.FeatureIndexException; |
||
35 | 23867 | jiyarza | |
36 | 25716 | jiyarza | |
37 | 23867 | jiyarza | /**
|
38 | 25122 | jiyarza | * This interface represents a local index on feature based data.
|
39 | 24804 | jiyarza | *
|
40 | 25122 | jiyarza | * All indexes are stored in local files. Creating server
|
41 | * side indexes is not supported.
|
||
42 | 24804 | jiyarza | *
|
43 | 25122 | jiyarza | *
|
44 | 23867 | jiyarza | * @author jyarza
|
45 | *
|
||
46 | */
|
||
47 | 23947 | jiyarza | public interface FeatureIndex { |
48 | 24206 | jiyarza | |
49 | 23867 | jiyarza | /** Index name */
|
50 | public String getName(); |
||
51 | 24206 | jiyarza | |
52 | 23947 | jiyarza | /** Attribute names */
|
53 | 24206 | jiyarza | public List getAttributeNames(); |
54 | |||
55 | 23867 | jiyarza | /** Data type */
|
56 | public int getDataType(); |
||
57 | 24206 | jiyarza | |
58 | 23867 | jiyarza | /**
|
59 | * Inserts a Feature in the index.
|
||
60 | * The Feature must contain a column that matches this index's column (name and data type)
|
||
61 | * @param feat
|
||
62 | */
|
||
63 | public void insert(Feature feat); |
||
64 | |||
65 | /**
|
||
66 | 24206 | jiyarza | * Inserts a FeatureSet into this index
|
67 | 23867 | jiyarza | * FeatureType is not checked so it will accept any FeatureType
|
68 | * as long as exists a column with a valid name
|
||
69 | 24206 | jiyarza | */
|
70 | 23947 | jiyarza | public void insert(FeatureSet data) throws DataException; |
71 | 24206 | jiyarza | |
72 | 23867 | jiyarza | /**
|
73 | * Deletes a Feature in the index.
|
||
74 | * The Feature must contain a column that matches this index's column (name and data type)
|
||
75 | * @param feat
|
||
76 | */
|
||
77 | public void delete(Feature feat); |
||
78 | |||
79 | /**
|
||
80 | 24206 | jiyarza | * Deletes a FeatureSet from this index
|
81 | 23867 | jiyarza | * FeatureType is not checked so it will accept any FeatureType
|
82 | * as long as exists a column with a valid name
|
||
83 | 24206 | jiyarza | */
|
84 | public void delete(FeatureSet data) throws FeatureIndexException; |
||
85 | |||
86 | 25077 | jiyarza | /**
|
87 | 25716 | jiyarza | * Returns a FeatureSet with the set of values that match the given value.
|
88 | 25077 | jiyarza | *
|
89 | * @param value
|
||
90 | * is the value to match.
|
||
91 | * @return
|
||
92 | 25716 | jiyarza | * a FeatureSet containing the values in the index that match the given value.
|
93 | 25077 | jiyarza | *
|
94 | * @throws FeatureIndexException
|
||
95 | */
|
||
96 | 25716 | jiyarza | public FeatureSet getMatchFeatureSet(Object value) |
97 | 24206 | jiyarza | throws FeatureIndexException;
|
98 | 24195 | jjdelcerro | |
99 | 25077 | jiyarza | /**
|
100 | 25716 | jiyarza | * Returns a FeatureSet with the set of values that belong to the range defined by value1 and value2.
|
101 | 25077 | jiyarza | *
|
102 | * @param value1
|
||
103 | * range lower limit.
|
||
104 | *
|
||
105 | * @param value2
|
||
106 | * range higher limit.
|
||
107 | *
|
||
108 | * @return
|
||
109 | 25716 | jiyarza | * a FeatureSet with the set of values that belong to the range defined by value1 and value2.
|
110 | 25077 | jiyarza | *
|
111 | * @throws FeatureIndexException
|
||
112 | */
|
||
113 | 25716 | jiyarza | public FeatureSet getRangeFeatureSet(Object value1, Object value2) |
114 | 24206 | jiyarza | throws FeatureIndexException;
|
115 | 24195 | jjdelcerro | |
116 | 25077 | jiyarza | /**
|
117 | 25716 | jiyarza | * Returns a FeatureSet with the set of up to <code>count</code> values that are nearest to the given value.
|
118 | 25077 | jiyarza | *
|
119 | * @param count
|
||
120 | 25716 | jiyarza | * maximum number of values that their resulting FeatureSet will return
|
121 | 25077 | jiyarza | *
|
122 | * @param value
|
||
123 | * the value around which the nearest <code>count</code> will be looked up.
|
||
124 | *
|
||
125 | * @return
|
||
126 | 25716 | jiyarza | * a FeatureSet with the set of up to <code>count</code> values that are nearest to the given value.
|
127 | 25077 | jiyarza | *
|
128 | * @throws FeatureIndexException
|
||
129 | */
|
||
130 | 25716 | jiyarza | public FeatureSet getNearestFeatureSet(int count, Object value) |
131 | 24206 | jiyarza | throws FeatureIndexException;
|
132 | 24195 | jjdelcerro | |
133 | 25077 | jiyarza | /**
|
134 | 25716 | jiyarza | * Returns a FeatureSet with the set of up to <code>count</code> values whose distance to the given value
|
135 | 25077 | jiyarza | * is not greater than <code>tolerance</code>
|
136 | *
|
||
137 | * @param count
|
||
138 | 25716 | jiyarza | * maximum number of values that their resulting FeatureSet will return
|
139 | 25077 | jiyarza | *
|
140 | * @param value
|
||
141 | * the value around which the nearest <code>count</code> will be looked up.
|
||
142 | *
|
||
143 | * @param tolerance
|
||
144 | * maximum distance from the given value.
|
||
145 | *
|
||
146 | * @return
|
||
147 | 25716 | jiyarza | * a FeatureSet with the set of up to <code>count</code> values that are nearest to the given value.
|
148 | 25077 | jiyarza | *
|
149 | * @throws FeatureIndexException
|
||
150 | */
|
||
151 | 25716 | jiyarza | public FeatureSet getNearestFeatureSet(int count, Object value, |
152 | 26325 | jmvivo | Object tolerance) throws FeatureIndexException; |
153 | 24195 | jjdelcerro | |
154 | 24206 | jiyarza | |
155 | 23867 | jiyarza | } |