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 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 new FeatureSetProvider.
      Parameters:
      store - the underlying FeatureStoreProvider to get the data from
      query - used to create the FeatureSetProvider
      providerFeatureType - 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

      protected AbstractFeatureStoreProvider getStore()
      Returns:
      the store
    • getQuery

      protected org.gvsig.fmap.dal.feature.FeatureQuery getQuery()
      Returns the FeatureQuery used 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.DataException
      Description copied from interface: FeatureSetProvider
      Returns an iterator over the elements in this set, in the order (if any) defined when the collection was obtained.
      Specified by:
      fastIterator in interface FeatureSetProvider
      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: FeatureSetProvider
      Returns an iterator over the elements in this set, in the order (if any) defined when the collection was obtained.
      Specified by:
      fastIterator in interface FeatureSetProvider
      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.DataException
      Description copied from interface: FeatureSetProvider
      Returns 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 FeatureProvider of the iterator, use the FeatureProvider.getCopy() to create a clone of the object.

      Specified by:
      iterator in interface FeatureSetProvider
      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: FeatureSetProvider
      Returns 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 FeatureProvider of the iterator, use the FeatureProvider.getCopy() to create a clone of the object.

      Specified by:
      iterator in interface FeatureSetProvider
      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 new Iterator, begginning at the specified data index.
      Parameters:
      index - the first element position to be returned by the Iterator
      Returns:
      a new Iterator
      Throws:
      org.gvsig.fmap.dal.exception.DataException - if there is an error creating the Iterator
    • 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 fast Iterator, begginning at the specified data index. By fast this means the object instances of data ( FeatureProvider) may be reused between the Iterator.next() method invocations.
      Parameters:
      index - the first element position to be returned by the Iterator
      Returns:
      a new Iterator
      Throws:
      org.gvsig.fmap.dal.exception.DataException - if there is an error creating the Iterator
    • createFastIterator

      protected AbstractFeatureProviderIterator createFastIterator(long index, long elements) throws org.gvsig.fmap.dal.exception.DataException
      Throws:
      org.gvsig.fmap.dal.exception.DataException
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getSpatialIndex

      protected org.gvsig.fmap.geom.SpatialIndex getSpatialIndex(String name)
    • createSpatialIterator

      protected Iterator createSpatialIterator(org.gvsig.fmap.dal.feature.FeatureType featureType, org.gvsig.fmap.dal.feature.FeatureQuery query)