Class FeaturePagingHelperImpl
java.lang.Object
org.gvsig.tools.dispose.impl.AbstractDisposable
org.gvsig.tools.dynobject.impl.DefaultDynObjectPagingHelper
org.gvsig.fmap.dal.feature.paging.impl.FeaturePagingHelperImpl
- All Implemented Interfaces:
Iterable<org.gvsig.fmap.dal.feature.Feature>,org.gvsig.fmap.dal.feature.paging.FeaturePagingHelper,org.gvsig.tools.dispose.Disposable,org.gvsig.tools.dynobject.DynObjectPagingHelper,org.gvsig.tools.paging.PagingCalculator,org.gvsig.tools.util.GetItem64<org.gvsig.fmap.dal.feature.Feature>,org.gvsig.tools.util.GetItemWithSize64<org.gvsig.fmap.dal.feature.Feature>,org.gvsig.tools.util.GetItemWithSizeAndIterator64<org.gvsig.fmap.dal.feature.Feature>,org.gvsig.tools.util.GetItemWithSizeIsEmptyAndIterator64<org.gvsig.fmap.dal.feature.Feature>,org.gvsig.tools.util.IsEmpty,org.gvsig.tools.util.Size64
public class FeaturePagingHelperImpl
extends org.gvsig.tools.dynobject.impl.DefaultDynObjectPagingHelper
implements org.gvsig.fmap.dal.feature.paging.FeaturePagingHelper
Helper class to access the values of a FeatureCollection by position. Handles
pagination automatically to avoid filling the memory in case of big
collections.
TODO: evaluate if its more convenient to read values in the background when
the returned value is near the end of the page, instead of loading a page on
demand.
- Author:
- gvSIG Team
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gvsig.tools.paging.PagingCalculator
org.gvsig.tools.paging.PagingCalculator.Sizeable -
Field Summary
Fields inherited from interface org.gvsig.tools.util.GetItemWithSizeAndIterator64
EMPTY_GETITEMWITHSIZEANDITERATOR64Fields inherited from interface org.gvsig.tools.util.GetItemWithSizeIsEmptyAndIterator64
EMPTY_GETITEMWITHSIZEISEMPTYANDITERATOR64Fields inherited from interface org.gvsig.tools.paging.PagingCalculator
DEFAULT_PAGE_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionFeaturePagingHelperImpl(org.gvsig.fmap.dal.feature.FeatureStore featureStore) Constructs a FeaturePagingHelperImpl from data of a FeatureStore.FeaturePagingHelperImpl(org.gvsig.fmap.dal.feature.FeatureStore featureStore, int pageSize) Constructs a FeaturePagingHelperImpl from data of a FeatureStore.FeaturePagingHelperImpl(org.gvsig.fmap.dal.feature.FeatureStore featureStore, org.gvsig.fmap.dal.feature.FeatureQuery featureQuery) Constructs a FeaturePagingHelperImpl from data of a FeatureStore.FeaturePagingHelperImpl(org.gvsig.fmap.dal.feature.FeatureStore featureStore, org.gvsig.fmap.dal.feature.FeatureQuery featureQuery, int pageSize) Constructs a FeaturePagingHelperImpl from data of a FeatureStore. -
Method Summary
Modifier and TypeMethodDescriptionasList()voiddelete(org.gvsig.fmap.dal.feature.Feature feature) protected voidorg.gvsig.fmap.dal.feature.Featureget64(long position) org.gvsig.tools.dynobject.DynObject[]org.gvsig.fmap.dal.feature.Feature[]org.gvsig.tools.dynobject.DynObjectgetDynObjectAt(long index) org.gvsig.tools.dynobject.DynObjectSetorg.gvsig.fmap.dal.feature.FeaturegetFeatureAt(long index) org.gvsig.fmap.dal.feature.FeatureQueryorg.gvsig.fmap.dal.feature.FeatureSetorg.gvsig.fmap.dal.feature.FeatureStoreorg.gvsig.fmap.dal.feature.FeatureTypeorg.gvsig.fmap.dal.feature.FeatureSelectionvoidinsert(org.gvsig.fmap.dal.feature.EditableFeature feature) booleanisEmpty()booleanIterator<org.gvsig.fmap.dal.feature.Feature> iterator()protected voidLoads all the Features of the current page.voidreload()voidvoidsetSelection(org.gvsig.fmap.dal.feature.FeatureSelection selection) voidsetSelectionUp(boolean selectionUp) longsize64()toString()voidupdate(org.gvsig.fmap.dal.feature.EditableFeature feature) Methods inherited from class org.gvsig.tools.dynobject.impl.DefaultDynObjectPagingHelper
getCalculator, getCurrentPage, getCurrentPageSize, getInitialIndex, getMaxPageSize, getNumPages, getTotalSize, setCalculator, setCurrentPage, setDefaultCalculator, setDynObjectSet, setMaxPageSizeMethods inherited from class org.gvsig.tools.dispose.impl.AbstractDisposable
dispose, disposeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.gvsig.tools.dispose.Disposable
disposeMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.gvsig.tools.paging.PagingCalculator
getCurrentPage, getCurrentPageSize, getInitialIndex, getMaxPageSize, getNumPages, getTotalSize, setCurrentPage, setMaxPageSize
-
Constructor Details
-
FeaturePagingHelperImpl
public FeaturePagingHelperImpl(org.gvsig.fmap.dal.feature.FeatureStore featureStore) throws org.gvsig.tools.exception.BaseException Constructs a FeaturePagingHelperImpl from data of a FeatureStore.- Parameters:
featureStore- to extract data from- Throws:
org.gvsig.fmap.dal.exception.DataException- if there is an error initializing the helperorg.gvsig.tools.exception.BaseException
-
FeaturePagingHelperImpl
public FeaturePagingHelperImpl(org.gvsig.fmap.dal.feature.FeatureStore featureStore, int pageSize) throws org.gvsig.tools.exception.BaseException Constructs a FeaturePagingHelperImpl from data of a FeatureStore.- Parameters:
featureStore- to extract data frompageSize- the number of elements per page data- Throws:
org.gvsig.fmap.dal.exception.DataException- if there is an error initializing the helperorg.gvsig.tools.exception.BaseException
-
FeaturePagingHelperImpl
public FeaturePagingHelperImpl(org.gvsig.fmap.dal.feature.FeatureStore featureStore, org.gvsig.fmap.dal.feature.FeatureQuery featureQuery) throws org.gvsig.tools.exception.BaseException Constructs a FeaturePagingHelperImpl from data of a FeatureStore.- Parameters:
featureStore- to extract data fromfeatureQuery-- Throws:
org.gvsig.fmap.dal.exception.DataException- if there is an error initializing the helperorg.gvsig.tools.exception.BaseException
-
FeaturePagingHelperImpl
public FeaturePagingHelperImpl(org.gvsig.fmap.dal.feature.FeatureStore featureStore, org.gvsig.fmap.dal.feature.FeatureQuery featureQuery, int pageSize) throws org.gvsig.tools.exception.BaseException Constructs a FeaturePagingHelperImpl from data of a FeatureStore.- Parameters:
featureStore-featureQuery-pageSize- the number of elements per page data- Throws:
org.gvsig.fmap.dal.exception.DataException- if there is an error initializing the helperorg.gvsig.tools.exception.BaseException
-
-
Method Details
-
isSelectionUp
public boolean isSelectionUp()- Specified by:
isSelectionUpin interfaceorg.gvsig.fmap.dal.feature.paging.FeaturePagingHelper- Returns:
- the selectionUp status
-
getSelection
public org.gvsig.fmap.dal.feature.FeatureSelection getSelection()- Specified by:
getSelectionin interfaceorg.gvsig.fmap.dal.feature.paging.FeaturePagingHelper
-
setSelection
public void setSelection(org.gvsig.fmap.dal.feature.FeatureSelection selection) - Specified by:
setSelectionin interfaceorg.gvsig.fmap.dal.feature.paging.FeaturePagingHelper
-
setSelectionUp
public void setSelectionUp(boolean selectionUp) - Specified by:
setSelectionUpin interfaceorg.gvsig.fmap.dal.feature.paging.FeaturePagingHelper
-
getFeatureAt
public org.gvsig.fmap.dal.feature.Feature getFeatureAt(long index) throws org.gvsig.tools.exception.BaseException - Specified by:
getFeatureAtin interfaceorg.gvsig.fmap.dal.feature.paging.FeaturePagingHelper- Throws:
org.gvsig.tools.exception.BaseException
-
getCurrentPageFeatures
public org.gvsig.fmap.dal.feature.Feature[] getCurrentPageFeatures()- Specified by:
getCurrentPageFeaturesin interfaceorg.gvsig.fmap.dal.feature.paging.FeaturePagingHelper
-
getFeatureSet
public org.gvsig.fmap.dal.feature.FeatureSet getFeatureSet()- Specified by:
getFeatureSetin interfaceorg.gvsig.fmap.dal.feature.paging.FeaturePagingHelper
-
getDynObjectSet
public org.gvsig.tools.dynobject.DynObjectSet getDynObjectSet()- Specified by:
getDynObjectSetin interfaceorg.gvsig.tools.dynobject.DynObjectPagingHelper- Overrides:
getDynObjectSetin classorg.gvsig.tools.dynobject.impl.DefaultDynObjectPagingHelper
-
reloadCurrentPage
public void reloadCurrentPage() throws org.gvsig.tools.exception.BaseException- Specified by:
reloadCurrentPagein interfaceorg.gvsig.tools.dynobject.DynObjectPagingHelper- Overrides:
reloadCurrentPagein classorg.gvsig.tools.dynobject.impl.DefaultDynObjectPagingHelper- Throws:
org.gvsig.tools.exception.BaseException
-
reload
public void reload() throws org.gvsig.tools.exception.BaseException- Specified by:
reloadin interfaceorg.gvsig.tools.dynobject.DynObjectPagingHelper- Overrides:
reloadin classorg.gvsig.tools.dynobject.impl.DefaultDynObjectPagingHelper- Throws:
org.gvsig.tools.exception.BaseException
-
getFeatureStore
public org.gvsig.fmap.dal.feature.FeatureStore getFeatureStore()- Specified by:
getFeatureStorein interfaceorg.gvsig.fmap.dal.feature.paging.FeaturePagingHelper
-
getFeatureQuery
public org.gvsig.fmap.dal.feature.FeatureQuery getFeatureQuery()- Specified by:
getFeatureQueryin interfaceorg.gvsig.fmap.dal.feature.paging.FeaturePagingHelper
-
loadCurrentPageData
protected void loadCurrentPageData() throws org.gvsig.tools.exception.BaseExceptionLoads all the Features of the current page.- Overrides:
loadCurrentPageDatain classorg.gvsig.tools.dynobject.impl.DefaultDynObjectPagingHelper- Throws:
org.gvsig.tools.exception.BaseException
-
delete
public void delete(org.gvsig.fmap.dal.feature.Feature feature) throws org.gvsig.tools.exception.BaseException - Specified by:
deletein interfaceorg.gvsig.fmap.dal.feature.paging.FeaturePagingHelper- Throws:
org.gvsig.tools.exception.BaseException
-
insert
public void insert(org.gvsig.fmap.dal.feature.EditableFeature feature) throws org.gvsig.tools.exception.BaseException - Specified by:
insertin interfaceorg.gvsig.fmap.dal.feature.paging.FeaturePagingHelper- Throws:
org.gvsig.tools.exception.BaseException
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceorg.gvsig.fmap.dal.feature.paging.FeaturePagingHelper- Specified by:
isEmptyin interfaceorg.gvsig.tools.util.IsEmpty
-
update
public void update(org.gvsig.fmap.dal.feature.EditableFeature feature) throws org.gvsig.tools.exception.BaseException - Specified by:
updatein interfaceorg.gvsig.fmap.dal.feature.paging.FeaturePagingHelper- Throws:
org.gvsig.tools.exception.BaseException
-
getFeatureType
public org.gvsig.fmap.dal.feature.FeatureType getFeatureType()- Specified by:
getFeatureTypein interfaceorg.gvsig.fmap.dal.feature.paging.FeaturePagingHelper
-
doDispose
protected void doDispose() throws org.gvsig.tools.exception.BaseException- Overrides:
doDisposein classorg.gvsig.tools.dynobject.impl.DefaultDynObjectPagingHelper- Throws:
org.gvsig.tools.exception.BaseException
-
getCurrentPageDynObjects
public org.gvsig.tools.dynobject.DynObject[] getCurrentPageDynObjects()- Specified by:
getCurrentPageDynObjectsin interfaceorg.gvsig.tools.dynobject.DynObjectPagingHelper- Overrides:
getCurrentPageDynObjectsin classorg.gvsig.tools.dynobject.impl.DefaultDynObjectPagingHelper
-
getDynObjectAt
public org.gvsig.tools.dynobject.DynObject getDynObjectAt(long index) throws org.gvsig.tools.exception.BaseException - Specified by:
getDynObjectAtin interfaceorg.gvsig.tools.dynobject.DynObjectPagingHelper- Overrides:
getDynObjectAtin classorg.gvsig.tools.dynobject.impl.DefaultDynObjectPagingHelper- Throws:
org.gvsig.tools.exception.BaseException
-
asList
- Specified by:
asListin interfaceorg.gvsig.fmap.dal.feature.paging.FeaturePagingHelper
-
asListOfDynObjects
- Specified by:
asListOfDynObjectsin interfaceorg.gvsig.fmap.dal.feature.paging.FeaturePagingHelper
-
size64
public long size64()- Specified by:
size64in interfaceorg.gvsig.tools.util.Size64
-
get64
public org.gvsig.fmap.dal.feature.Feature get64(long position) - Specified by:
get64in interfaceorg.gvsig.tools.util.GetItem64<org.gvsig.fmap.dal.feature.Feature>
-
iterator
-
toString
-