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

History | View | Annotate | Download (4.56 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
import java.util.List;
32

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

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

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

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

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

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

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

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

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

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

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

    
138
        boolean isSelectionUp();
139
        
140
     /**
141
      * Return a List of Fearures with the contents of this PagingHelper
142
      * 
143
      * @return List of Features
144
      */
145
     List asList();
146
    
147
     /**
148
      * Return a List of DynObjects with the contents of this PagingHelper
149
      * 
150
      * @return List of DynObjects
151
      */
152
     List asListOfDynObjects();
153
    
154
}