Package org.gvsig.fmap.dal.feature.spi
Class AbstractFeatureSetProvider
java.lang.Object
org.gvsig.tools.dispose.impl.AbstractDisposable
org.gvsig.fmap.dal.feature.spi.AbstractFeatureSetProvider
- All Implemented Interfaces:
FeatureSetProvider,org.gvsig.tools.dispose.Disposable
- Direct Known Subclasses:
MemoryFeatureSet
public abstract class AbstractFeatureSetProvider
extends org.gvsig.tools.dispose.impl.AbstractDisposable
implements FeatureSetProvider
Base implementation for
FeatureSetProviders, adding some utility
methods.- Author:
- 2009- César Ordiñana - gvSIG team
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAbstractFeatureSetProvider(AbstractFeatureStoreProvider store, org.gvsig.fmap.dal.feature.FeatureQuery query, org.gvsig.fmap.dal.feature.FeatureType providerFeatureType) AbstractFeatureSetProvider(AbstractFeatureStoreProvider store, org.gvsig.fmap.dal.feature.FeatureQuery query, org.gvsig.fmap.dal.feature.FeatureType providerFeatureType, org.gvsig.fmap.dal.feature.FeatureType storeFeatureType) Creates a newFeatureSetProvider. -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract AbstractFeatureProviderIteratorcreateFastIterator(long index) Creates a new fastIterator, begginning at the specified data index.protected AbstractFeatureProviderIteratorcreateFastIterator(long index, long elements) protected abstract AbstractFeatureProviderIteratorcreateIterator(long index) Creates a newIterator, begginning at the specified data index.protected AbstractFeatureProviderIteratorcreateIterator(long index, long elements) protected IteratorcreateSpatialIterator(org.gvsig.fmap.dal.feature.FeatureType featureType, org.gvsig.fmap.dal.feature.FeatureQuery query) final org.gvsig.tools.dispose.DisposableIteratorReturns an iterator over the elements in this set, in the order (if any) defined when the collection was obtained.final org.gvsig.tools.dispose.DisposableIteratorfastIterator(long index) final org.gvsig.tools.dispose.DisposableIteratorfastIterator(long index, long elements) Returns an iterator over the elements in this set, in the order (if any) defined when the collection was obtained.protected org.gvsig.fmap.dal.feature.FeatureTypeReturns the type of features from provider to load.protected org.gvsig.fmap.dal.feature.FeatureTypeReturns the type of features from provider to load.protected org.gvsig.fmap.dal.feature.FeatureQuerygetQuery()Returns theFeatureQueryused to create this set.protected org.gvsig.fmap.geom.SpatialIndexgetSpatialIndex(String name) protected AbstractFeatureStoreProvidergetStore()Return theAbstractFeatureStoreProvider.protected org.gvsig.fmap.dal.feature.FeatureTypeReturns the type of features from store to load.final org.gvsig.tools.dispose.DisposableIteratoriterator()Returns an iterator over the elements in this set, in the order (if any) defined when the collection was obtained.final org.gvsig.tools.dispose.DisposableIteratoriterator(long index) final org.gvsig.tools.dispose.DisposableIteratoriterator(long index, long elements) Returns an iterator over the elements in this set, in the order (if any) defined when the collection was obtained.toString()Methods inherited from class org.gvsig.tools.dispose.impl.AbstractDisposable
dispose, dispose, doDisposeMethods 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 org.gvsig.fmap.dal.feature.spi.FeatureSetProvider
canFilter, canIterateFromIndex, canOrder, getSize, isEmpty
-
Field Details
-
LOGGER
protected static final org.slf4j.Logger LOGGER
-
-
Constructor Details
-
AbstractFeatureSetProvider
public AbstractFeatureSetProvider(AbstractFeatureStoreProvider store, org.gvsig.fmap.dal.feature.FeatureQuery query, org.gvsig.fmap.dal.feature.FeatureType providerFeatureType, org.gvsig.fmap.dal.feature.FeatureType storeFeatureType) Creates a newFeatureSetProvider.- Parameters:
store- the underlyingFeatureStoreProviderto get the data fromquery- used to create theFeatureSetProviderproviderFeatureType- the type of feature to get
-
AbstractFeatureSetProvider
public AbstractFeatureSetProvider(AbstractFeatureStoreProvider store, org.gvsig.fmap.dal.feature.FeatureQuery query, org.gvsig.fmap.dal.feature.FeatureType providerFeatureType)
-
-
Method Details
-
getStore
Return theAbstractFeatureStoreProvider.- Returns:
- the store
-
getQuery
protected org.gvsig.fmap.dal.feature.FeatureQuery getQuery()Returns theFeatureQueryused to create this set.- Returns:
- the query
-
getProviderFeatureType
protected org.gvsig.fmap.dal.feature.FeatureType getProviderFeatureType()Returns the type of features from provider to load.- Returns:
- the providerFeatureType
-
getStoreFeatureType
protected org.gvsig.fmap.dal.feature.FeatureType getStoreFeatureType()Returns the type of features from store to load.- Returns:
- the storeFeatureType
-
getFeatureType
protected org.gvsig.fmap.dal.feature.FeatureType getFeatureType()Returns the type of features from provider to load.- Returns:
- the providerFeatureType
-
fastIterator
public final org.gvsig.tools.dispose.DisposableIterator fastIterator() throws org.gvsig.fmap.dal.exception.DataExceptionDescription copied from interface:FeatureSetProviderReturns an iterator over the elements in this set, in the order (if any) defined when the collection was obtained.- Specified by:
fastIteratorin interfaceFeatureSetProvider- Returns:
- an iterator of the elements in this collection (in proper sequence).
- Throws:
org.gvsig.fmap.dal.exception.DataException- if there is an error getting the iterator- See Also:
-
fastIterator
public final org.gvsig.tools.dispose.DisposableIterator fastIterator(long index) throws org.gvsig.fmap.dal.exception.DataException - Throws:
org.gvsig.fmap.dal.exception.DataException
-
fastIterator
public final org.gvsig.tools.dispose.DisposableIterator fastIterator(long index, long elements) throws org.gvsig.fmap.dal.exception.DataException Description copied from interface:FeatureSetProviderReturns an iterator over the elements in this set, in the order (if any) defined when the collection was obtained.- Specified by:
fastIteratorin interfaceFeatureSetProvider- Parameters:
index- index of first element to be returned from the iterator (by a call to the next method).elements-- Returns:
- an iterator of the elements in this collection (in proper sequence).
- Throws:
org.gvsig.fmap.dal.exception.DataException- if there is an error getting the iterator- See Also:
-
iterator
public final org.gvsig.tools.dispose.DisposableIterator iterator() throws org.gvsig.fmap.dal.exception.DataExceptionDescription copied from interface:FeatureSetProviderReturns an iterator over the elements in this set, in the order (if any) defined when the collection was obtained.Fast in this case means that each of the elements returned may be a reused or pooled object instance, so don't use it to be stored in any way.
If you need to store one of the
FeatureProviderof the iterator, use theFeatureProvider.getCopy()to create a clone of the object.- Specified by:
iteratorin interfaceFeatureSetProvider- Returns:
- an iterator of the elements in this collection (in proper sequence).
- Throws:
org.gvsig.fmap.dal.exception.DataException- if there is an error getting the iterator
-
iterator
public final org.gvsig.tools.dispose.DisposableIterator iterator(long index) throws org.gvsig.fmap.dal.exception.DataException - Throws:
org.gvsig.fmap.dal.exception.DataException
-
iterator
public final org.gvsig.tools.dispose.DisposableIterator iterator(long index, long elements) throws org.gvsig.fmap.dal.exception.DataException Description copied from interface:FeatureSetProviderReturns an iterator over the elements in this set, in the order (if any) defined when the collection was obtained.Fast in this case means that each of the elements returned may be a reused or pooled object instance, so don't use it to be stored in any way.
If you need to store one of the
FeatureProviderof the iterator, use theFeatureProvider.getCopy()to create a clone of the object.- Specified by:
iteratorin interfaceFeatureSetProvider- Parameters:
index- index of first element to be returned from the iterator (by a call to the next method).elements-- Returns:
- an iterator of the elements in this collection (in proper sequence).
- Throws:
org.gvsig.fmap.dal.exception.DataException- if there is an error getting the iterator
-
createIterator
protected abstract AbstractFeatureProviderIterator createIterator(long index) throws org.gvsig.fmap.dal.exception.DataException Creates a newIterator, begginning at the specified data index. -
createIterator
protected AbstractFeatureProviderIterator createIterator(long index, long elements) throws org.gvsig.fmap.dal.exception.DataException - Throws:
org.gvsig.fmap.dal.exception.DataException
-
createFastIterator
protected abstract AbstractFeatureProviderIterator createFastIterator(long index) throws org.gvsig.fmap.dal.exception.DataException Creates a new fastIterator, begginning at the specified data index. By fast this means the object instances of data (FeatureProvider) may be reused between theIterator.next()method invocations. -
createFastIterator
protected AbstractFeatureProviderIterator createFastIterator(long index, long elements) throws org.gvsig.fmap.dal.exception.DataException - Throws:
org.gvsig.fmap.dal.exception.DataException
-
toString
-
getSpatialIndex
-
createSpatialIterator
protected Iterator createSpatialIterator(org.gvsig.fmap.dal.feature.FeatureType featureType, org.gvsig.fmap.dal.feature.FeatureQuery query)
-