Statistics
| Revision:

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 @ 40559

History | View | Annotate | Download (4.17 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
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 3
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
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
/*
25
 * AUTHORS (In addition to CIT):
26
 * 2008 {DiSiD Technologies}  {Add pagination to a FeatureCollection}
27
 */
28
package org.gvsig.fmap.dal.feature.paging;
29

    
30
import java.util.Iterator;
31

    
32
import org.gvsig.fmap.dal.feature.EditableFeature;
33
import org.gvsig.fmap.dal.feature.Feature;
34
import org.gvsig.fmap.dal.feature.FeatureQuery;
35
import org.gvsig.fmap.dal.feature.FeatureSet;
36
import org.gvsig.fmap.dal.feature.FeatureStore;
37
import org.gvsig.fmap.dal.feature.FeatureType;
38
import org.gvsig.tools.dynobject.DynObjectPagingHelper;
39
import org.gvsig.tools.exception.BaseException;
40

    
41
/**
42
 * Helper interface to access the values of a FeatureCollection by position.
43
 * 
44
 * @author gvSIG team
45
 */
46
public interface FeaturePagingHelper extends DynObjectPagingHelper {
47

    
48
    /**
49
     * Returns the Feature located at the index position.
50
     * 
51
     * @param index
52
     *            to locate the Feature in the Collection
53
     * @return the Feature located at the index position
54
     * @throws BaseException
55
     *             if there is an error getting the Feature
56
     */
57
    Feature getFeatureAt(long index) throws BaseException;
58

    
59
    /**
60
     * Returns all the values of the current loaded page.
61
     *
62
     * @return all the values of the current loaded page
63
     */
64
    Feature[] getCurrentPageFeatures();
65

    
66
    /**
67
     * Returns the FeatureStore used to fetch the data.
68
     *
69
     * @return the FeatureStore
70
     */
71
    FeatureStore getFeatureStore();
72

    
73
    /**
74
     * Returns the query used to load the Features.
75
     *
76
     * @return the query used to load the Features
77
     */
78
    FeatureQuery getFeatureQuery();
79

    
80
        /**
81
         * Returns the FeatureType used of the data.
82
         *
83
         * @return the FeatureType of the data
84
         */
85
        FeatureType getFeatureType();
86

    
87
    /**
88
     * Updates a {@link Feature} with the given {@link EditableFeature} in the
89
     * current {@link FeatureSet}. <br>
90
     * 
91
     * @param feature
92
     *            an instance of {@link EditableFeature} with which to update
93
     *            the associated {@link Feature}.
94
     * 
95
     * @throws BaseException
96
     * 
97
     * @see {@link FeatureSet#update(EditableFeature)}
98
     *      {@link FeaturePagingHelper#getFeatureSet()}
99
     */
100
        void update(EditableFeature feature) throws BaseException;
101

    
102
    /**
103
     * Deletes a {@link Feature} from current {@link FeatureSet}.<br>
104
     * 
105
     * @param feature
106
     *            the {@link Feature} to delete.
107
     * 
108
     * @throws BaseException
109
     * 
110
     * @see {@link FeatureSet#delete(Feature)}
111
     *      {@link FeaturePagingHelper#getFeatureSet()}
112
     */
113
        void delete(Feature feature) throws BaseException;
114

    
115
    /**
116
     * Inserts a new feature in this {@link FeatureSet}. It needs to be an
117
     * instance of {@link EditableFeature} as it has not been stored yet.<br>
118
     * 
119
     * Any {@link Iterator} from this store that was still in use can will not
120
     * reflect this change.
121
     * 
122
     * @param feature
123
     *            the {@link EditableFeature} to insert.
124
     * 
125
     * @throws BaseException
126
     * 
127
     * @see {@link FeatureSet#insert(EditableFeature)}
128
     *      {@link FeaturePagingHelper#getFeatureSet()}
129
     */
130
        void insert(EditableFeature feature) throws BaseException;
131

    
132
        /**
133
         * Sets that the selected Features get returned first.
134
         */
135
        void setSelectionUp(boolean selectionUp);
136

    
137
}