Class LargeFeatureSelection

java.lang.Object
org.gvsig.tools.visitor.impl.AbstractVisitable
org.gvsig.tools.visitor.impl.AbstractIndexedVisitable
org.gvsig.fmap.dal.feature.impl.featureset.AbstractFeatureSet
org.gvsig.fmap.dal.feature.impl.LargeFeatureSelection
All Implemented Interfaces:
Cloneable, Iterable<org.gvsig.fmap.dal.feature.Feature>, org.gvsig.fmap.dal.DataSelection, org.gvsig.fmap.dal.DataSet, org.gvsig.fmap.dal.feature.FeatureReferenceSelection, org.gvsig.fmap.dal.feature.FeatureSelection, org.gvsig.fmap.dal.feature.FeatureSet, org.gvsig.tools.dispose.Disposable, org.gvsig.tools.lang.Cloneable, org.gvsig.tools.observer.ComplexObservable, org.gvsig.tools.observer.Observable, org.gvsig.tools.observer.Observer, org.gvsig.tools.observer.WeakReferencingObservable, org.gvsig.tools.persistence.Persistent, org.gvsig.tools.util.IsEmpty, org.gvsig.tools.util.Size, org.gvsig.tools.util.Size64, org.gvsig.tools.visitor.IndexedVisitable, org.gvsig.tools.visitor.Visitable

public class LargeFeatureSelection extends AbstractFeatureSet implements org.gvsig.fmap.dal.feature.FeatureSelection
Default implementation of the FeatureSelection interface. Internally, only FeatureReference values are stored. This implementation performs better if used with the selection related methods: select, deselect and isSelected ones.
Author:
Cèsar Ordiñana
  • Constructor Details

    • LargeFeatureSelection

      public LargeFeatureSelection(DefaultFeatureStore featureStore) throws org.gvsig.fmap.dal.exception.DataException
      Creates a DefaultFeatureSelection, with a FeatureStore.
      Parameters:
      featureStore - the FeatureStore to load Features from
      Throws:
      org.gvsig.fmap.dal.exception.DataException - if there is an error while getting the total number of Features of the Store.
      See Also:
      • invalid reference
        AbstractSetBasedDataSelection#DefaultSelection(int)
    • LargeFeatureSelection

      public LargeFeatureSelection(org.gvsig.fmap.dal.feature.FeatureStore featureStore, FeatureSelectionHelper helper) throws org.gvsig.fmap.dal.exception.DataException
      Creates a new Selection with the total size of Features from which the selection will be performed.
      Parameters:
      featureStore - the FeatureStore of the selected FeatureReferences
      helper - to get some information of the Store
      Throws:
      org.gvsig.fmap.dal.exception.DataException - if there is an error while getting the total number of Features of the Store.
    • LargeFeatureSelection

      public LargeFeatureSelection()
      Constructor used by the persistence manager. Don't use directly. After to invoke this method, the persistence manager calls the the method loadFromState(PersistentState) to set the values of the internal attributes that this class needs to work.
  • Method Details

    • getFeatureStore

      public org.gvsig.fmap.dal.feature.FeatureStore getFeatureStore()
      Specified by:
      getFeatureStore in interface org.gvsig.fmap.dal.feature.FeatureSet
      Specified by:
      getFeatureStore in class AbstractFeatureSet
    • enableNotifications

      public void enableNotifications()
      Specified by:
      enableNotifications in interface org.gvsig.tools.observer.ComplexObservable
    • disableNotifications

      public void disableNotifications()
      Specified by:
      disableNotifications in interface org.gvsig.tools.observer.ComplexObservable
    • getSelectedCount

      public long getSelectedCount()
      Specified by:
      getSelectedCount in interface org.gvsig.fmap.dal.feature.FeatureReferenceSelection
    • select

      public boolean select(org.gvsig.fmap.dal.feature.FeatureReference reference)
      Specified by:
      select in interface org.gvsig.fmap.dal.feature.FeatureReferenceSelection
    • deselect

      public boolean deselect(org.gvsig.fmap.dal.feature.FeatureReference reference)
      Specified by:
      deselect in interface org.gvsig.fmap.dal.feature.FeatureReferenceSelection
    • referenceIterator

      public Iterator<org.gvsig.fmap.dal.feature.FeatureReference> referenceIterator()
      Specified by:
      referenceIterator in interface org.gvsig.fmap.dal.feature.FeatureReferenceSelection
    • referenceIterable

      public Iterable<org.gvsig.fmap.dal.feature.FeatureReference> referenceIterable()
      Specified by:
      referenceIterable in interface org.gvsig.fmap.dal.feature.FeatureReferenceSelection
    • selectAll

      public void selectAll() throws org.gvsig.fmap.dal.exception.DataException
      Specified by:
      selectAll in interface org.gvsig.fmap.dal.feature.FeatureReferenceSelection
      Throws:
      org.gvsig.fmap.dal.exception.DataException
    • deselectAll

      public void deselectAll() throws org.gvsig.fmap.dal.exception.DataException
      Specified by:
      deselectAll in interface org.gvsig.fmap.dal.feature.FeatureReferenceSelection
      Throws:
      org.gvsig.fmap.dal.exception.DataException
    • isSelected

      public boolean isSelected(org.gvsig.fmap.dal.feature.FeatureReference reference)
      Specified by:
      isSelected in interface org.gvsig.fmap.dal.feature.FeatureReferenceSelection
    • reverse

      public void reverse()
      Specified by:
      reverse in interface org.gvsig.fmap.dal.feature.FeatureReferenceSelection
    • dispose

      public void dispose()
      Specified by:
      dispose in interface org.gvsig.tools.dispose.Disposable
    • update

      public void update(org.gvsig.tools.observer.Observable o, Object o1)
      Specified by:
      update in interface org.gvsig.tools.observer.Observer
    • addObserver

      public void addObserver(org.gvsig.tools.observer.Observer obsrvr)
      Specified by:
      addObserver in interface org.gvsig.tools.observer.Observable
    • deleteObserver

      public void deleteObserver(org.gvsig.tools.observer.Observer obsrvr)
      Specified by:
      deleteObserver in interface org.gvsig.tools.observer.Observable
    • deleteObservers

      public void deleteObservers()
      Specified by:
      deleteObservers in interface org.gvsig.tools.observer.Observable
    • beginComplexNotification

      public void beginComplexNotification()
      Specified by:
      beginComplexNotification in interface org.gvsig.tools.observer.ComplexObservable
    • endComplexNotification

      public void endComplexNotification()
      Specified by:
      endComplexNotification in interface org.gvsig.tools.observer.ComplexObservable
    • saveToState

      public void saveToState(org.gvsig.tools.persistence.PersistentState ps) throws org.gvsig.tools.persistence.exception.PersistenceException
      Specified by:
      saveToState in interface org.gvsig.tools.persistence.Persistent
      Throws:
      org.gvsig.tools.persistence.exception.PersistenceException
    • select

      public boolean select(org.gvsig.fmap.dal.feature.Feature feature)
      Specified by:
      select in interface org.gvsig.fmap.dal.feature.FeatureSelection
    • select

      public boolean select(org.gvsig.fmap.dal.feature.FeatureSet features) throws org.gvsig.fmap.dal.exception.DataException
      Specified by:
      select in interface org.gvsig.fmap.dal.feature.FeatureSelection
      Throws:
      org.gvsig.fmap.dal.exception.DataException
    • deselect

      public boolean deselect(org.gvsig.fmap.dal.feature.Feature feature)
      Specified by:
      deselect in interface org.gvsig.fmap.dal.feature.FeatureSelection
    • deselect

      public boolean deselect(org.gvsig.fmap.dal.feature.FeatureSet features) throws org.gvsig.fmap.dal.exception.DataException
      Specified by:
      deselect in interface org.gvsig.fmap.dal.feature.FeatureSelection
      Throws:
      org.gvsig.fmap.dal.exception.DataException
    • isSelected

      public boolean isSelected(org.gvsig.fmap.dal.feature.Feature feature)
      Specified by:
      isSelected in interface org.gvsig.fmap.dal.feature.FeatureSelection
    • getDefaultFeatureType

      public org.gvsig.fmap.dal.feature.FeatureType getDefaultFeatureType()
      Specified by:
      getDefaultFeatureType in interface org.gvsig.fmap.dal.feature.FeatureSet
    • getFeatureTypes

      public List getFeatureTypes()
      Specified by:
      getFeatureTypes in interface org.gvsig.fmap.dal.feature.FeatureSet
    • getSize

      public long getSize() throws org.gvsig.fmap.dal.exception.DataException
      Specified by:
      getSize in interface org.gvsig.fmap.dal.feature.FeatureSet
      Throws:
      org.gvsig.fmap.dal.exception.DataException
    • iterator

      public org.gvsig.tools.dispose.DisposableIterator iterator(long index)
      Returns the list of selected values, or the deselected ones if the selection has been reversed. WARN: not very good performance implementation.
      Specified by:
      iterator in interface org.gvsig.fmap.dal.feature.FeatureSet
    • iterator

      public org.gvsig.tools.dispose.DisposableIterator iterator(long index, long elements)
      Specified by:
      iterator in interface org.gvsig.fmap.dal.feature.FeatureSet
    • fastIterator

      public org.gvsig.tools.dispose.DisposableIterator fastIterator(long index)
      Returns the list of selected values, or the deselected ones if the selection has been reversed. WARN: not really a fast implementation.
      Specified by:
      fastIterator in interface org.gvsig.fmap.dal.feature.FeatureSet
    • fastIterator

      public org.gvsig.tools.dispose.DisposableIterator fastIterator(long index, long elements)
      Specified by:
      fastIterator in interface org.gvsig.fmap.dal.feature.FeatureSet
    • clearFeatureReferences

      protected void clearFeatureReferences()
    • delete

      public void delete(org.gvsig.fmap.dal.feature.Feature feature) throws org.gvsig.fmap.dal.exception.DataException
      Specified by:
      delete in interface org.gvsig.fmap.dal.feature.FeatureSet
      Throws:
      org.gvsig.fmap.dal.exception.DataException
    • insert

      public void insert(org.gvsig.fmap.dal.feature.EditableFeature feature) throws org.gvsig.fmap.dal.exception.DataException
      Specified by:
      insert in interface org.gvsig.fmap.dal.feature.FeatureSet
      Throws:
      org.gvsig.fmap.dal.exception.DataException
    • update

      public void update(org.gvsig.fmap.dal.feature.EditableFeature feature) throws org.gvsig.fmap.dal.exception.DataException
      Specified by:
      update in interface org.gvsig.fmap.dal.feature.FeatureSet
      Throws:
      org.gvsig.fmap.dal.exception.DataException
    • commitChanges

      public void commitChanges() throws org.gvsig.fmap.dal.exception.DataException
      Specified by:
      commitChanges in interface org.gvsig.fmap.dal.feature.FeatureSet
      Throws:
      org.gvsig.fmap.dal.exception.DataException
    • loadFromState

      public void loadFromState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException
      Specified by:
      loadFromState in interface org.gvsig.tools.persistence.Persistent
      Throws:
      org.gvsig.tools.persistence.exception.PersistenceException
    • doDispose

      protected void doDispose() throws org.gvsig.tools.exception.BaseException
      Throws:
      org.gvsig.tools.exception.BaseException
    • registerPersistent

      public static void registerPersistent()
    • clone

      public Object clone() throws CloneNotSupportedException
      Specified by:
      clone in interface org.gvsig.tools.lang.Cloneable
      Overrides:
      clone in class Object
      Throws:
      CloneNotSupportedException
    • doAccept

      protected void doAccept(org.gvsig.tools.visitor.Visitor visitor, long firstValueIndex, long elements) throws org.gvsig.tools.exception.BaseException
      Overrides:
      doAccept in class AbstractFeatureSet
      Throws:
      org.gvsig.tools.exception.BaseException
    • isAvailable

      public boolean isAvailable()
      Specified by:
      isAvailable in interface org.gvsig.fmap.dal.feature.FeatureReferenceSelection
      Specified by:
      isAvailable in interface org.gvsig.fmap.dal.feature.FeatureSelection