public class DefaultFeatureSelection extends DefaultFeatureReferenceSelection implements FeatureSelection
DefaultFeatureReferenceSelection.SelectionDataDYNCLASS_PERSISTENT_NAME, selectionData| Constructor and Description |
|---|
DefaultFeatureSelection()
Constructor used by the persistence manager.
|
DefaultFeatureSelection(DefaultFeatureStore featureStore)
Creates a DefaultFeatureSelection, with a FeatureStore.
|
DefaultFeatureSelection(FeatureStore featureStore,
FeatureSelectionHelper helper)
Creates a new Selection with the total size of Features from which the
selection will be performed.
|
| Modifier and Type | Method and Description |
|---|---|
void |
accept(Visitor visitor)
Provides each value of this Store to the provided
Visitor. |
void |
accept(Visitor visitor,
long firstValueIndex)
Provides each value of this Store to the provided
Visitor,
beginning from the provided index position. |
protected void |
clearFeatureReferences()
Removes all the stored FeatureRefence objects.
|
Object |
clone()
Creates a copy of the object.
|
void |
delete(Feature feature)
Deletes a
Feature from this FeatureSet. |
boolean |
deselect(Feature feature)
Removes a feature from the selection.
|
boolean |
deselect(Feature feature,
boolean undoable) |
boolean |
deselect(FeatureSet features)
Removes a DataSet of features from the selection.
|
boolean |
deselect(FeatureSet features,
boolean undoable) |
protected void |
doDispose()
Internal implementation for the
AbstractDisposable.dispose() method, to be
implemented by child classes. |
DisposableIterator |
fastIterator()
Returns the list of selected values, or the deselected ones if the
selection has been reversed.
|
DisposableIterator |
fastIterator(long index)
Returns the list of selected values, or the deselected ones if the
selection has been reversed.
|
FeatureType |
getDefaultFeatureType()
Returns the default
FeatureType of this FeatureSet. |
DynObjectSet |
getDynObjectSet()
Returns a
DynObjectSet of the contents of this set. |
DynObjectSet |
getDynObjectSet(boolean fast)
Returns a
DynObjectSet of the contents of this set. |
List |
getFeatureTypes()
Returns a list of the
FeatureType(s) in this FeatureSet. |
long |
getSize()
Returns the number of
Feature(s) contained in this FeatureSet. |
void |
insert(EditableFeature feature)
Inserts a new feature in this set.
|
boolean |
isEmpty()
Indicates whether this FeatureSet contains zero features.
|
boolean |
isSelected(Feature feature)
Returns if a feature is selected.
|
DisposableIterator |
iterator()
Returns the list of selected values, or the deselected ones if the
selection has been reversed.
|
DisposableIterator |
iterator(long index)
Returns the list of selected values, or the deselected ones if the
selection has been reversed.
|
void |
loadFromState(PersistentState state)
Set the state of the object from the state passed as parameter.
|
static void |
registerPersistent() |
boolean |
select(Feature feature)
Adds a feature to the selection.
|
boolean |
select(Feature feature,
boolean undoable) |
boolean |
select(FeatureSet features)
Adds a DataSet of features to the selection.
|
boolean |
select(FeatureSet features,
boolean undoable) |
void |
update(EditableFeature feature)
Updates a
Feature with the given EditableFeature. |
addObserver, addObserver, addObservers, beginComplexNotification, countObservers, deleteObserver, deleteObserver, deleteObservers, deselect, deselect, deselectAll, deselectAll, disableNotifications, enableNotifications, endComplexNotification, getCommands, getData, getFeatureStore, getSelectedCount, inComplex, isEnabledNotifications, isFromStore, isReversed, isSelected, notifyObservers, notifyObservers, referenceIterator, reverse, reverse, saveToState, select, select, selectAll, selectAll, setData, toString, updatedispose, disposeequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdeselect, deselectAll, getSelectedCount, isSelected, referenceIterator, reverse, select, selectAllisFromStoredisposeaddObserver, deleteObserver, deleteObserversbeginComplexNotification, disableNotifications, enableNotifications, endComplexNotificationsaveToStatepublic DefaultFeatureSelection(DefaultFeatureStore featureStore) throws DataException
featureStore - the FeatureStore to load Features fromDataException - if there is an error while getting the total number of
Features of the Store.AbstractSetBasedDataSelection#DefaultSelection(int)public DefaultFeatureSelection(FeatureStore featureStore, FeatureSelectionHelper helper) throws DataException
featureStore - the FeatureStore of the selected FeatureReferenceshelper - to get some information of the StoreDataException - if there is an error while getting the total number of
Features of the Store.public DefaultFeatureSelection()
loadFromState(PersistentState) to set the values of the internal
attributes that this class needs to work.public boolean select(Feature feature)
FeatureSelectionselect in interface FeatureSelectionfeature - the selected featurepublic boolean select(Feature feature, boolean undoable)
undoable - if the action must be undoableselect(Feature)public boolean select(FeatureSet features) throws DataException
FeatureSelectionselect in interface FeatureSelectionfeatures - the selected featuresDataException - if there is an error reading the FeatureSet valuespublic boolean select(FeatureSet features, boolean undoable) throws DataException
undoable - if the action must be undoableDataExceptionselect(FeatureSet)public boolean deselect(Feature feature)
FeatureSelectiondeselect in interface FeatureSelectionfeature - the deselected featurepublic boolean deselect(Feature feature, boolean undoable)
undoable - if the action must be undoabledeselect(Feature)public boolean deselect(FeatureSet features) throws DataException
FeatureSelectiondeselect in interface FeatureSelectionfeatures - the deselected featuresDataException - if there is an error reading the FeatureSet valuespublic boolean deselect(FeatureSet features, boolean undoable) throws DataException
undoable - if the action must be undoableDataExceptiondeselect(FeatureSet)public boolean isSelected(Feature feature)
FeatureSelectionisSelected in interface FeatureSelectionfeature - to checkpublic FeatureType getDefaultFeatureType()
FeatureSetFeatureType of this FeatureSet.getDefaultFeatureType in interface FeatureSetFeatureType in this FeatureSet.public List getFeatureTypes()
FeatureSetFeatureType(s) in this FeatureSet.getFeatureTypes in interface FeatureSetFeatureType(s) in this FeatureSet.public long getSize()
throws DataException
FeatureSetFeature(s) contained in this FeatureSet.
The value returned by this method won't be accurate when
the FeatureStore is being edited and this set's features
are modified, added or deleted.getSize in interface FeatureSetFeature(s) contained in this FeatureSet.DataExceptionpublic boolean isEmpty()
throws DataException
FeatureSetisEmpty in interface FeatureSetDataExceptionpublic DisposableIterator iterator()
iterator in interface FeatureSetDataSet.accept(org.gvsig.tools.visitor.Visitor),
FeatureSet.accept(org.gvsig.tools.visitor.Visitor, long),
FeatureSet.fastIterator(),
FeatureSet.fastIterator(long)public DisposableIterator iterator(long index)
iterator in interface FeatureSetindex - index of first element to be returned from the iterator (by a
call to the next method).DataSet.accept(org.gvsig.tools.visitor.Visitor),
FeatureSet.accept(org.gvsig.tools.visitor.Visitor, long),
FeatureSet.fastIterator(),
FeatureSet.fastIterator(long)public DisposableIterator fastIterator()
fastIterator in interface FeatureSetDataSet.accept(org.gvsig.tools.visitor.Visitor),
FeatureSet.accept(org.gvsig.tools.visitor.Visitor, long)public DisposableIterator fastIterator(long index)
fastIterator in interface FeatureSetindex - position in which the iterator is initially located.DataSet.accept(org.gvsig.tools.visitor.Visitor),
FeatureSet.accept(org.gvsig.tools.visitor.Visitor, long)protected void clearFeatureReferences()
DefaultFeatureReferenceSelectionclearFeatureReferences in class DefaultFeatureReferenceSelectionpublic void delete(Feature feature) throws DataException
FeatureSetFeature from this FeatureSet.DisposableIterator from this store that was still in use will be
unsafe. Use Iterator.remove() instead.delete in interface FeatureSetfeature - the Feature to delete.DataExceptionpublic void insert(EditableFeature feature) throws DataException
FeatureSetEditableFeature as it has not been stored yet.DisposableIterator from this store that was still in use can will not
reflect this change.insert in interface FeatureSetfeature - the EditableFeature to insert.DataExceptionpublic void update(EditableFeature feature) throws DataException
FeatureSetFeature with the given EditableFeature.DisposableIterator from this store that was still in use can will not
reflect this change.update in interface FeatureSetfeature - an instance of EditableFeature with which to update
the associated Feature.DataExceptionpublic void loadFromState(PersistentState state) throws PersistenceException
PersistentloadFromState in interface PersistentloadFromState in class DefaultFeatureReferenceSelectionPersistenceExceptionpublic void accept(Visitor visitor) throws BaseException
DataSetVisitor.
The values received through the Visitor.visit(Object) method
may be transient, reused or externally modifiable, so they can't
be used to be stored in any external form out of the visit method.
If you need to store any of the values out of the
Visitor.visit(Object) method execution, create a copy or clone
the received value in order to be stored.accept in interface DataSetaccept in interface Visitableaccept in class DefaultFeatureReferenceSelectionvisitor - the visitor to apply to each value.BaseException - if there is an error while performing the visitpublic final void accept(Visitor visitor, long firstValueIndex) throws BaseException
FeatureSetVisitor,
beginning from the provided index position.
The values received through the Visitor.visit(Object) method
may be transient, reused or externally modifiable, so they can't
be used to be stored in any external form out of the visit method.
If you need to store any of the values out of the
Visitor.visit(Object) method execution, create a copy or clone
the received value in order to be stored.accept in interface FeatureSetaccept in interface IndexedVisitablevisitor - the visitor to apply to each value.firstValueIndex - index of first element to be visited by the VisitorBaseException - if there is an error while performing the visitprotected void doDispose()
throws BaseException
AbstractDisposableAbstractDisposable.dispose() method, to be
implemented by child classes.doDispose in class DefaultFeatureReferenceSelectionBaseExceptionAbstractDisposable.dispose()public static void registerPersistent()
public Object clone() throws CloneNotSupportedException
Cloneableclone in class DefaultFeatureReferenceSelectionCloneNotSupportedException - if the instance of the object cannot
be cloned. As this is extending Cloneable so
its sure it implements it, so this exception may be used for problems
on specific object instances.Object#clone()}.public DynObjectSet getDynObjectSet()
FeatureSetDynObjectSet of the contents of this set.
Defaults to fast iteration.getDynObjectSet in interface FeatureSetDynObjectSetpublic DynObjectSet getDynObjectSet(boolean fast)
FeatureSetDynObjectSet of the contents of this set.getDynObjectSet in interface FeatureSetfast - if the set will be able to be iterated in a fast way, by
reusing the DynObject instance for each
Feature instance.DynObjectSet