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

History | View | Annotate | Download (4.63 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 modify it under
7
 * the terms of the GNU General Public License as published by the Free Software
8
 * Foundation; either version 3 of the License, or (at your option) any later
9
 * version.
10
 *
11
 * This program is distributed in the hope that it will be useful, but WITHOUT
12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14
 * details.
15
 *
16
 * You should have received a copy of the GNU General Public License along with
17
 * this program; if not, write to the Free Software Foundation, Inc., 51
18
 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us at info AT
21
 * gvsig.com, or visit our website www.gvsig.com.
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
import java.util.List;
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.FeatureSelection;
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 to locate the Feature in the Collection
53
     * @return the Feature located at the index position
54
     * @throws BaseException 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 an instance of {@link EditableFeature} with which to
91
     * update the associated {@link Feature}.
92
     *
93
     * @throws BaseException
94
     *
95
     * @see {@link FeatureSet#update(EditableFeature)}
96
     *      {@link FeaturePagingHelper#getFeatureSet()}
97
     */
98
    void update(EditableFeature feature) throws BaseException;
99

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

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

    
128
    /**
129
     * Sets that the selected Features get returned first.
130
     */
131
    void setSelectionUp(boolean selectionUp);
132

    
133
    boolean isSelectionUp();
134

    
135
    /**
136
     * Return a List of Fearures with the contents of this PagingHelper
137
     *
138
     * @return List of Features
139
     */
140
    List asList();
141

    
142
    /**
143
     * Return a List of DynObjects with the contents of this PagingHelper
144
     *
145
     * @return List of DynObjects
146
     */
147
    List asListOfDynObjects();
148

    
149
    public FeatureSelection getSelection();
150

    
151
    public void setSelection(FeatureSelection selection);
152

    
153
    public boolean isEmpty();
154
}