public class LargeFeatureSelection extends AbstractFeatureSet implements FeatureSelection
| Modifier and Type | Class and Description |
|---|---|
class |
LargeFeatureSelection.RemoveFromFeatureSelectionException |
LOGEMTPY_FEATURE_SELECTIONEMPTY_FEATURESET| Constructor and Description |
|---|
LargeFeatureSelection()
Constructor used by the persistence manager.
|
LargeFeatureSelection(DefaultFeatureStore featureStore)
Creates a DefaultFeatureSelection, with a FeatureStore.
|
LargeFeatureSelection(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 |
addObserver(Observer obsrvr) |
void |
beginComplexNotification()
Sets the Observable in complex notification mode.
|
protected void |
clearFeatureReferences() |
java.lang.Object |
clone()
Creates a copy of the object.
|
void |
commitChanges() |
void |
delete(Feature feature)
Deletes a
Feature from this FeatureSet. |
void |
deleteObserver(Observer obsrvr) |
void |
deleteObservers() |
boolean |
deselect(Feature feature)
Removes a feature from the selection.
|
boolean |
deselect(FeatureReference reference)
Removes a feature from the selection.
|
boolean |
deselect(FeatureSet features)
Removes a DataSet of features from the selection.
|
void |
deselectAll()
Deselects all values.
|
void |
disableNotifications()
Disable the notification of events to registered Observers.
|
void |
dispose()
Disposes the current object, to allow it to close and dispose any used
resources.
|
protected void |
doAccept(Visitor visitor,
long firstValueIndex,
long elements) |
protected void |
doDispose() |
void |
enableNotifications()
Enable (default) the notification of events to registered Observers.
|
void |
endComplexNotification()
Ends the complex notification mode.
|
DisposableIterator |
fastIterator(long index)
Returns the list of selected values, or the deselected ones if the
selection has been reversed.
|
DisposableIterator |
fastIterator(long index,
long elements) |
FeatureType |
getDefaultFeatureType()
Returns the default
FeatureType of this FeatureSet. |
FeatureStore |
getFeatureStore() |
java.util.List |
getFeatureTypes()
Returns a list of the
FeatureType(s) in this FeatureSet. |
long |
getSelectedCount()
Returns the number of selected values.
|
long |
getSize()
Returns the number of
Feature(s) contained in this FeatureSet. |
void |
insert(EditableFeature feature)
Inserts a new feature in this set.
|
boolean |
isAvailable() |
boolean |
isSelected(Feature feature)
Returns if a feature is selected.
|
boolean |
isSelected(FeatureReference reference)
Returns if a feature is selected.
|
DisposableIterator |
iterator(long index)
Returns the list of selected values, or the deselected ones if the
selection has been reversed.
|
DisposableIterator |
iterator(long index,
long elements) |
void |
loadFromState(PersistentState state)
Set the state of the object from the state passed as parameter.
|
java.lang.Iterable<FeatureReference> |
referenceIterable() |
java.util.Iterator<FeatureReference> |
referenceIterator()
Returns an unmodifiable Iterator of selected feature references.
|
static void |
registerPersistent() |
void |
reverse()
Reverses the selection.
|
void |
saveToState(PersistentState ps)
Saves the internal state of the object on the provided
PersistentState object.
|
boolean |
select(Feature feature)
Adds a feature to the selection.
|
boolean |
select(FeatureReference reference)
Adds a feature to the selection.
|
boolean |
select(FeatureSet features)
Adds a DataSet of features to the selection.
|
void |
selectAll()
Selects all values.
|
void |
update(EditableFeature feature)
Updates a
Feature with the given EditableFeature. |
void |
update(Observable o,
java.lang.Object o1)
Called whenever a
Observable object is changed and this
Observer has registered on it to receive notifications. |
accept, doAccept, fastIterator, first, getDynObjectSet, getDynObjectSet, isEmpty, isFromStore, iterable, iterable, iterator, makeFilter, size, size64, toJson, toJSON, toJsonBuilderaccept, doAcceptacceptequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaccept, isFromStoreaccept, accept, fastIterator, first, getDynObjectSet, getDynObjectSet, iterable, iterable, iterator, makeFilter, toJson, toJSON, toJsonBuilderisEmpty, isEmpty, isEmpty, isEmptyQuietlycloneQuietly, cloneQuietlypublic LargeFeatureSelection(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 LargeFeatureSelection(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 LargeFeatureSelection()
loadFromState(PersistentState) to set the values of the internal
attributes that this class needs to work.public FeatureStore getFeatureStore()
getFeatureStore in interface FeatureSetgetFeatureStore in class AbstractFeatureSetpublic void enableNotifications()
ComplexObservableenableNotifications in interface ComplexObservablepublic void disableNotifications()
ComplexObservabledisableNotifications in interface ComplexObservablepublic long getSelectedCount()
FeatureReferenceSelectiongetSelectedCount in interface FeatureReferenceSelectionpublic boolean select(FeatureReference reference)
FeatureReferenceSelectionselect in interface FeatureReferenceSelectionreference - the selected feature referencepublic boolean deselect(FeatureReference reference)
FeatureReferenceSelectiondeselect in interface FeatureReferenceSelectionreference - the deselected feature referencepublic java.util.Iterator<FeatureReference> referenceIterator()
FeatureReferenceSelectionreferenceIterator in interface FeatureReferenceSelectionpublic java.lang.Iterable<FeatureReference> referenceIterable()
referenceIterable in interface FeatureReferenceSelectionpublic void selectAll()
throws DataException
FeatureReferenceSelectionselectAll in interface FeatureReferenceSelectionDataException - if there is an error selecting all valuespublic void deselectAll()
throws DataException
FeatureReferenceSelectiondeselectAll in interface FeatureReferenceSelectionDataException - if there is an error deselecting all valuespublic boolean isSelected(FeatureReference reference)
FeatureReferenceSelectionisSelected in interface FeatureReferenceSelectionreference - to checkpublic void reverse()
FeatureReferenceSelectionreverse in interface FeatureReferenceSelectionpublic void dispose()
DisposableNOTE:After calling this method, the object may not be usable anymore.
dispose in interface Disposablepublic void update(Observable o, java.lang.Object o1)
ObserverObservable object is changed and this
Observer has registered on it to receive notifications.
Implementations of this method will be called for each simple notification or, if a complex notification is created, for each of the child notifications.
In the latter case, don't assume any ordering in the notification between
this Observer and other Observers listening to the same
Observable.
In a complex notification scenario, if you want to receive only the
complex notification and not each of the child notifications, just
implement the ComplexObserver and prepare this method
implementation to handle receiving DefaultComplexNotification instances
as well as direct notification objects.
public void addObserver(Observer obsrvr)
addObserver in interface Observablepublic void deleteObserver(Observer obsrvr)
deleteObserver in interface Observablepublic void deleteObservers()
deleteObservers in interface Observablepublic void beginComplexNotification()
ComplexObservablebeginComplexNotification in interface ComplexObservablepublic void endComplexNotification()
ComplexObservable
If a observer is a ComplexObserver, it will be notified with a
single DefaultComplexNotification instead of each of the notifications.
Some important notes to take into account when calling this method.
Observer is processing a notification another Observer is
registered to the source Observable, it won't get any of the
notifications currently being notified, but future ones.endComplexNotification in interface ComplexObservablepublic void saveToState(PersistentState ps) throws PersistenceException
PersistentsaveToState in interface PersistentPersistenceExceptionpublic boolean select(Feature feature)
FeatureSelectionselect in interface FeatureSelectionfeature - the selected featurepublic boolean select(FeatureSet features) throws DataException
FeatureSelectionselect in interface FeatureSelectionfeatures - the selected featuresDataException - if there is an error reading the FeatureSet valuespublic boolean deselect(Feature feature)
FeatureSelectiondeselect in interface FeatureSelectionfeature - the deselected featurepublic boolean deselect(FeatureSet features) throws DataException
FeatureSelectiondeselect in interface FeatureSelectionfeatures - the deselected featuresDataException - if there is an error reading the FeatureSet valuespublic boolean isSelected(Feature feature)
FeatureSelectionisSelected in interface FeatureSelectionfeature - to checkpublic FeatureType getDefaultFeatureType()
FeatureSetFeatureType of this FeatureSet.getDefaultFeatureType in interface FeatureSetFeatureType in this FeatureSet.public java.util.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 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 iterator(long index, long elements)
iterator in interface FeatureSetpublic 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)public DisposableIterator fastIterator(long index, long elements)
fastIterator in interface FeatureSetprotected void clearFeatureReferences()
public 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 commitChanges()
throws DataException
commitChanges in interface FeatureSetDataExceptionpublic void loadFromState(PersistentState state) throws PersistenceException
PersistentloadFromState in interface PersistentPersistenceExceptionprotected void doDispose()
throws BaseException
BaseExceptionpublic static void registerPersistent()
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
Cloneableclone in class java.lang.Objectjava.lang.CloneNotSupportedException - 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()}.protected void doAccept(Visitor visitor, long firstValueIndex, long elements) throws BaseException
doAccept in class AbstractFeatureSetBaseExceptionpublic boolean isAvailable()
isAvailable in interface FeatureReferenceSelectionisAvailable in interface FeatureSelection