Revision 33205 branches/v2_0_0_prep/libraries/libFMap_dal/src/org/gvsig/fmap/dal/feature/paging/FeaturePagingHelper.java

View differences:

FeaturePagingHelper.java
35 35
import org.gvsig.fmap.dal.feature.FeatureSet;
36 36
import org.gvsig.fmap.dal.feature.FeatureStore;
37 37
import org.gvsig.fmap.dal.feature.FeatureType;
38
import org.gvsig.tools.dispose.Disposable;
38
import org.gvsig.tools.dynobject.DynObjectPagingHelper;
39 39

  
40 40
/**
41 41
 * Helper interface to access the values of a FeatureCollection by position.
42
 *
43
 * @author <a href="mailto:cordin@disid.com">C?sar Ordi?ana</a>
42
 * 
43
 * @author gvSIG team
44 44
 */
45
public interface FeaturePagingHelper extends Disposable {
45
public interface FeaturePagingHelper extends DynObjectPagingHelper {
46 46

  
47
    static final int DEFAULT_PAGE_SIZE = 100;
48

  
49 47
    /**
50
     * Returns the current maximum number of Features per page.
51
     *
52
     * @return the current maximum page size
53
     */
54
    int getMaxPageSize();
55

  
56
    /**
57
     * Sets the current maximum number of Features per page. As the page size
58
     * changes, the current page of data is reloaded.
59
     *
60
     * @param pageSize
61
     *            the maximum number of Feature per page
62
     * @throws DataException
63
     *             if there is an error reloading the current page
64
     */
65
    void setMaxPageSize(int pageSize) throws DataException;
66

  
67
    /**
68
     * Returns the number of pages available in the collection, calculated with
69
     * the total number of elements and the maximum number of elements per page.
70
     *
71
     * @return the number of pages available
72
     */
73
    long getNumPages();
74

  
75
    /**
76
     * Returns the number of the currently loaded page of Features (zero based).
77
     *
78
     * @return the current page number
79
     */
80
    long getCurrentPage();
81

  
82
    /**
83
     * Sets the current page number, and loads the Features for that page.
84
     *
85
     * @param page
86
     *            the page to load
87
     * @throws DataException
88
     *             if there is an error setting the current page
89
     */
90
    void setCurrentPage(long page) throws DataException;
91

  
92
    /**
93
     * Returns the number of elements of the entire Collection.
94
     *
95
     * @return the number of elements
96
     * @throws DataException
97
     *             if there is an error getting the total number of Features
98
     */
99
    long getTotalSize() throws DataException;
100

  
101
    /**
102 48
     * Returns the Feature located at the index position.
103 49
     *
104 50
     * @param index
......
145 91
	FeatureType getFeatureType();
146 92

  
147 93
	/**
148
	 * Reloads the current page of data from the collection.
149
	 *
150
	 * @throws DataException
151
	 *             if there is an error reloading the current page
152
	 */
153
    void reloadCurrentPage() throws DataException;
154

  
155
	/**
156
	 * Reloads everything, using the current query.
157
	 *
158
	 * @throws DataException
159
	 */
160
    void reload() throws DataException;
161

  
162
	/**
163 94
	 * Updates a {@link Feature} with the given {@link EditableFeature} in the
164 95
	 * current {@link FeatureSet}. <br>
165 96
	 *

Also available in: Unified diff