Package org.gvsig.fmap.dal.feature.impl
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
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.gvsig.fmap.dal.feature.impl.featureset.AbstractFeatureSet
LOGFields inherited from interface org.gvsig.fmap.dal.feature.FeatureSelection
EMTPY_FEATURE_SELECTIONFields inherited from interface org.gvsig.fmap.dal.feature.FeatureSet
EMPTY_FEATURESET -
Constructor Summary
ConstructorsConstructorDescriptionConstructor used by the persistence manager.LargeFeatureSelection(org.gvsig.fmap.dal.feature.FeatureStore featureStore, FeatureSelectionHelper helper) Creates a new Selection with the total size of Features from which the selection will be performed.LargeFeatureSelection(DefaultFeatureStore featureStore) Creates a DefaultFeatureSelection, with a FeatureStore. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddObserver(org.gvsig.tools.observer.Observer obsrvr) voidprotected voidclone()voidvoiddelete(org.gvsig.fmap.dal.feature.Feature feature) voiddeleteObserver(org.gvsig.tools.observer.Observer obsrvr) voidbooleandeselect(org.gvsig.fmap.dal.feature.Feature feature) booleandeselect(org.gvsig.fmap.dal.feature.FeatureReference reference) booleandeselect(org.gvsig.fmap.dal.feature.FeatureSet features) voidvoidvoiddispose()protected voiddoAccept(org.gvsig.tools.visitor.Visitor visitor, long firstValueIndex, long elements) protected voidvoidvoidorg.gvsig.tools.dispose.DisposableIteratorfastIterator(long index) Returns the list of selected values, or the deselected ones if the selection has been reversed.org.gvsig.tools.dispose.DisposableIteratorfastIterator(long index, long elements) org.gvsig.fmap.dal.feature.FeatureTypeorg.gvsig.fmap.dal.feature.FeatureStorelonglonggetSize()voidinsert(org.gvsig.fmap.dal.feature.EditableFeature feature) booleanbooleanisSelected(org.gvsig.fmap.dal.feature.Feature feature) booleanisSelected(org.gvsig.fmap.dal.feature.FeatureReference reference) org.gvsig.tools.dispose.DisposableIteratoriterator(long index) Returns the list of selected values, or the deselected ones if the selection has been reversed.org.gvsig.tools.dispose.DisposableIteratoriterator(long index, long elements) voidloadFromState(org.gvsig.tools.persistence.PersistentState state) Iterable<org.gvsig.fmap.dal.feature.FeatureReference> Iterator<org.gvsig.fmap.dal.feature.FeatureReference> static voidvoidreverse()voidsaveToState(org.gvsig.tools.persistence.PersistentState ps) booleanselect(org.gvsig.fmap.dal.feature.Feature feature) booleanselect(org.gvsig.fmap.dal.feature.FeatureReference reference) booleanselect(org.gvsig.fmap.dal.feature.FeatureSet features) voidvoidupdate(org.gvsig.fmap.dal.feature.EditableFeature feature) voidMethods inherited from class org.gvsig.fmap.dal.feature.impl.featureset.AbstractFeatureSet
accept, doAccept, fastIterator, first, getDynObjectSet, getDynObjectSet, isEmpty, isFromStore, iterable, iterable, iterator, makeFilter, size, size64, toJson, toJSON, toJsonBuilderMethods inherited from class org.gvsig.tools.visitor.impl.AbstractIndexedVisitable
accept, doAcceptMethods inherited from class org.gvsig.tools.visitor.impl.AbstractVisitable
acceptMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gvsig.fmap.dal.DataSet
accept, isFromStoreMethods inherited from interface org.gvsig.fmap.dal.feature.FeatureSet
accept, accept, fastIterator, first, getDynObjectSet, getDynObjectSet, iterable, iterable, iterator, makeFilter, toJson, toJSON, toJsonBuilderMethods inherited from interface org.gvsig.tools.util.IsEmpty
isEmptyMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.gvsig.tools.util.Size
sizeMethods inherited from interface org.gvsig.tools.util.Size64
size64
-
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:
-
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 FeatureReferenceshelper- 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 methodloadFromState(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:
getFeatureStorein interfaceorg.gvsig.fmap.dal.feature.FeatureSet- Specified by:
getFeatureStorein classAbstractFeatureSet
-
enableNotifications
public void enableNotifications()- Specified by:
enableNotificationsin interfaceorg.gvsig.tools.observer.ComplexObservable
-
disableNotifications
public void disableNotifications()- Specified by:
disableNotificationsin interfaceorg.gvsig.tools.observer.ComplexObservable
-
getSelectedCount
public long getSelectedCount()- Specified by:
getSelectedCountin interfaceorg.gvsig.fmap.dal.feature.FeatureReferenceSelection
-
select
public boolean select(org.gvsig.fmap.dal.feature.FeatureReference reference) - Specified by:
selectin interfaceorg.gvsig.fmap.dal.feature.FeatureReferenceSelection
-
deselect
public boolean deselect(org.gvsig.fmap.dal.feature.FeatureReference reference) - Specified by:
deselectin interfaceorg.gvsig.fmap.dal.feature.FeatureReferenceSelection
-
referenceIterator
- Specified by:
referenceIteratorin interfaceorg.gvsig.fmap.dal.feature.FeatureReferenceSelection
-
referenceIterable
- Specified by:
referenceIterablein interfaceorg.gvsig.fmap.dal.feature.FeatureReferenceSelection
-
selectAll
public void selectAll() throws org.gvsig.fmap.dal.exception.DataException- Specified by:
selectAllin interfaceorg.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:
deselectAllin interfaceorg.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:
isSelectedin interfaceorg.gvsig.fmap.dal.feature.FeatureReferenceSelection
-
reverse
public void reverse()- Specified by:
reversein interfaceorg.gvsig.fmap.dal.feature.FeatureReferenceSelection
-
dispose
public void dispose()- Specified by:
disposein interfaceorg.gvsig.tools.dispose.Disposable
-
update
- Specified by:
updatein interfaceorg.gvsig.tools.observer.Observer
-
addObserver
public void addObserver(org.gvsig.tools.observer.Observer obsrvr) - Specified by:
addObserverin interfaceorg.gvsig.tools.observer.Observable
-
deleteObserver
public void deleteObserver(org.gvsig.tools.observer.Observer obsrvr) - Specified by:
deleteObserverin interfaceorg.gvsig.tools.observer.Observable
-
deleteObservers
public void deleteObservers()- Specified by:
deleteObserversin interfaceorg.gvsig.tools.observer.Observable
-
beginComplexNotification
public void beginComplexNotification()- Specified by:
beginComplexNotificationin interfaceorg.gvsig.tools.observer.ComplexObservable
-
endComplexNotification
public void endComplexNotification()- Specified by:
endComplexNotificationin interfaceorg.gvsig.tools.observer.ComplexObservable
-
saveToState
public void saveToState(org.gvsig.tools.persistence.PersistentState ps) throws org.gvsig.tools.persistence.exception.PersistenceException - Specified by:
saveToStatein interfaceorg.gvsig.tools.persistence.Persistent- Throws:
org.gvsig.tools.persistence.exception.PersistenceException
-
select
public boolean select(org.gvsig.fmap.dal.feature.Feature feature) - Specified by:
selectin interfaceorg.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:
selectin interfaceorg.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:
deselectin interfaceorg.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:
deselectin interfaceorg.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:
isSelectedin interfaceorg.gvsig.fmap.dal.feature.FeatureSelection
-
getDefaultFeatureType
public org.gvsig.fmap.dal.feature.FeatureType getDefaultFeatureType()- Specified by:
getDefaultFeatureTypein interfaceorg.gvsig.fmap.dal.feature.FeatureSet
-
getFeatureTypes
- Specified by:
getFeatureTypesin interfaceorg.gvsig.fmap.dal.feature.FeatureSet
-
getSize
public long getSize() throws org.gvsig.fmap.dal.exception.DataException- Specified by:
getSizein interfaceorg.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:
iteratorin interfaceorg.gvsig.fmap.dal.feature.FeatureSet
-
iterator
public org.gvsig.tools.dispose.DisposableIterator iterator(long index, long elements) - Specified by:
iteratorin interfaceorg.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:
fastIteratorin interfaceorg.gvsig.fmap.dal.feature.FeatureSet
-
fastIterator
public org.gvsig.tools.dispose.DisposableIterator fastIterator(long index, long elements) - Specified by:
fastIteratorin interfaceorg.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:
deletein interfaceorg.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:
insertin interfaceorg.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:
updatein interfaceorg.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:
commitChangesin interfaceorg.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:
loadFromStatein interfaceorg.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
- Specified by:
clonein interfaceorg.gvsig.tools.lang.Cloneable- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-
doAccept
protected void doAccept(org.gvsig.tools.visitor.Visitor visitor, long firstValueIndex, long elements) throws org.gvsig.tools.exception.BaseException - Overrides:
doAcceptin classAbstractFeatureSet- Throws:
org.gvsig.tools.exception.BaseException
-
isAvailable
public boolean isAvailable()- Specified by:
isAvailablein interfaceorg.gvsig.fmap.dal.feature.FeatureReferenceSelection- Specified by:
isAvailablein interfaceorg.gvsig.fmap.dal.feature.FeatureSelection
-