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

History | View | Annotate | Download (4.73 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.dispose.Disposable;
40
import org.gvsig.tools.dynobject.DynObjectPagingHelper;
41
import org.gvsig.tools.exception.BaseException;
42

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

    
50
    /**
51
     * Returns the Feature located at the index position.
52
     *
53
     * @param index to locate the Feature in the Collection
54
     * @return the Feature located at the index position
55
     * @throws BaseException 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 an instance of {@link EditableFeature} with which to
92
     * update 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 the {@link Feature} to delete.
105
     *
106
     * @throws BaseException
107
     *
108
     * @see {@link FeatureSet#delete(Feature)}
109
     *      {@link FeaturePagingHelper#getFeatureSet()}
110
     */
111
    void delete(Feature feature) throws BaseException;
112

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

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

    
134
    boolean isSelectionUp();
135

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

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

    
150
    public FeatureSelection getSelection();
151

    
152
    public void setSelection(FeatureSelection selection);
153

    
154
    public boolean isEmpty();
155
    
156
    public FeatureSet getFeatureSet();
157
}