svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.dal / org.gvsig.fmap.dal.api / src / main / java / org / gvsig / fmap / dal / feature / paging / FeaturePagingHelper.java @ 40435
History | View | Annotate | Download (4.13 KB)
1 |
/* 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 |
*
|
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} {Add pagination to a FeatureCollection}
|
26 |
*/
|
27 |
package org.gvsig.fmap.dal.feature.paging; |
28 |
|
29 |
import java.util.Iterator; |
30 |
|
31 |
import org.gvsig.fmap.dal.feature.EditableFeature; |
32 |
import org.gvsig.fmap.dal.feature.Feature; |
33 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
34 |
import org.gvsig.fmap.dal.feature.FeatureSet; |
35 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
36 |
import org.gvsig.fmap.dal.feature.FeatureType; |
37 |
import org.gvsig.tools.dynobject.DynObjectPagingHelper; |
38 |
import org.gvsig.tools.exception.BaseException; |
39 |
|
40 |
/**
|
41 |
* Helper interface to access the values of a FeatureCollection by position.
|
42 |
*
|
43 |
* @author gvSIG team
|
44 |
*/
|
45 |
public interface FeaturePagingHelper extends DynObjectPagingHelper { |
46 |
|
47 |
/**
|
48 |
* Returns the Feature located at the index position.
|
49 |
*
|
50 |
* @param index
|
51 |
* to locate the Feature in the Collection
|
52 |
* @return the Feature located at the index position
|
53 |
* @throws BaseException
|
54 |
* if there is an error getting the Feature
|
55 |
*/
|
56 |
Feature getFeatureAt(long index) throws BaseException; |
57 |
|
58 |
/**
|
59 |
* Returns all the values of the current loaded page.
|
60 |
*
|
61 |
* @return all the values of the current loaded page
|
62 |
*/
|
63 |
Feature[] getCurrentPageFeatures();
|
64 |
|
65 |
/**
|
66 |
* Returns the FeatureStore used to fetch the data.
|
67 |
*
|
68 |
* @return the FeatureStore
|
69 |
*/
|
70 |
FeatureStore getFeatureStore(); |
71 |
|
72 |
/**
|
73 |
* Returns the query used to load the Features.
|
74 |
*
|
75 |
* @return the query used to load the Features
|
76 |
*/
|
77 |
FeatureQuery getFeatureQuery(); |
78 |
|
79 |
/**
|
80 |
* Returns the FeatureType used of the data.
|
81 |
*
|
82 |
* @return the FeatureType of the data
|
83 |
*/
|
84 |
FeatureType getFeatureType(); |
85 |
|
86 |
/**
|
87 |
* Updates a {@link Feature} with the given {@link EditableFeature} in the
|
88 |
* current {@link FeatureSet}. <br>
|
89 |
*
|
90 |
* @param feature
|
91 |
* an instance of {@link EditableFeature} with which to update
|
92 |
* the associated {@link Feature}.
|
93 |
*
|
94 |
* @throws BaseException
|
95 |
*
|
96 |
* @see {@link FeatureSet#update(EditableFeature)}
|
97 |
* {@link FeaturePagingHelper#getFeatureSet()}
|
98 |
*/
|
99 |
void update(EditableFeature feature) throws BaseException; |
100 |
|
101 |
/**
|
102 |
* Deletes a {@link Feature} from current {@link FeatureSet}.<br>
|
103 |
*
|
104 |
* @param feature
|
105 |
* the {@link Feature} to delete.
|
106 |
*
|
107 |
* @throws BaseException
|
108 |
*
|
109 |
* @see {@link FeatureSet#delete(Feature)}
|
110 |
* {@link FeaturePagingHelper#getFeatureSet()}
|
111 |
*/
|
112 |
void delete(Feature feature) throws BaseException; |
113 |
|
114 |
/**
|
115 |
* Inserts a new feature in this {@link FeatureSet}. It needs to be an
|
116 |
* instance of {@link EditableFeature} as it has not been stored yet.<br>
|
117 |
*
|
118 |
* Any {@link Iterator} from this store that was still in use can will not
|
119 |
* reflect this change.
|
120 |
*
|
121 |
* @param feature
|
122 |
* the {@link EditableFeature} to insert.
|
123 |
*
|
124 |
* @throws BaseException
|
125 |
*
|
126 |
* @see {@link FeatureSet#insert(EditableFeature)}
|
127 |
* {@link FeaturePagingHelper#getFeatureSet()}
|
128 |
*/
|
129 |
void insert(EditableFeature feature) throws BaseException; |
130 |
|
131 |
/**
|
132 |
* Sets that the selected Features get returned first.
|
133 |
*/
|
134 |
void setSelectionUp(boolean selectionUp); |
135 |
|
136 |
} |