public class DefaultFeatureReferenceSelection extends AbstractDisposable implements FeatureReferenceSelection
reverse() method.| Modifier and Type | Class and Description |
|---|---|
static class |
DefaultFeatureReferenceSelection.SelectionData |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DYNCLASS_PERSISTENT_NAME |
protected static Logger |
LOGGER |
protected DefaultFeatureReferenceSelection.SelectionData |
selectionData |
| Constructor and Description |
|---|
DefaultFeatureReferenceSelection()
Constructor used by the persistence manager.
|
DefaultFeatureReferenceSelection(DefaultFeatureStore featureStore)
Creates a new Selection with the total size of Features from which the
selection will be performed.
|
DefaultFeatureReferenceSelection(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 |
addObserver(Observer observer) |
void |
beginComplexNotification()
Sets the Observable in complex notification mode.
|
protected void |
clearFeatureReferences()
Removes all the stored FeatureRefence objects.
|
java.lang.Object |
clone() |
void |
deleteObserver(Observer observer) |
void |
deleteObservers() |
boolean |
deselect(FeatureReference reference)
Removes a feature from the selection.
|
boolean |
deselect(FeatureReference reference,
boolean undoable) |
void |
deselectAll()
Deselects all values.
|
void |
deselectAll(boolean undoable) |
void |
disableNotifications()
Disable the notification of events to registered Observers.
|
protected void |
doDispose()
Internal implementation for the
AbstractDisposable.dispose() method, to be
implemented by child classes. |
void |
enableNotifications()
Enable (default) the notification of events to registered Observers.
|
void |
endComplexNotification()
Ends the complex notification mode.
|
protected FeatureCommandsStack |
getCommands()
Returns the reference to the commands record.
|
DefaultFeatureReferenceSelection.SelectionData |
getData() |
FeatureStore |
getFeatureStore()
Returns the FeatureStore of the selected FeatureReferences.
|
long |
getSelectedCount()
Returns the number of selected values.
|
boolean |
inComplex() |
boolean |
isAvailable() |
boolean |
isEmpty() |
boolean |
isEnabledNotifications() |
boolean |
isFromStore(DataStore store)
Indicates whether this DataSet belongs to a specific store
|
protected boolean |
isReversed() |
boolean |
isSelected(FeatureReference reference)
Returns if a feature is selected.
|
void |
loadFromState(PersistentState state)
Set the state of the object from the state passed as parameter.
|
void |
notifyObservers() |
void |
notifyObservers(java.lang.Object arg) |
java.lang.Iterable<FeatureReference> |
referenceIterable() |
FeatureReferenceIterator |
referenceIterator()
Returns an unmodifiable Iterator of selected feature references.
|
static void |
registerPersistent() |
void |
reverse()
Reverses the selection.
|
void |
reverse(boolean undoable) |
void |
saveToState(PersistentState state)
Saves the internal state of the object on the provided
PersistentState object.
|
boolean |
select(FeatureReference reference)
Adds a feature to the selection.
|
boolean |
select(FeatureReference reference,
boolean undoable) |
void |
selectAll()
Selects all values.
|
void |
selectAll(boolean undoable) |
void |
setData(DefaultFeatureReferenceSelection.SelectionData selectionData) |
java.lang.String |
toString() |
void |
update(Observable observable,
java.lang.Object notification)
Called whenever a
Observable object is changed and this
Observer has registered on it to receive notifications. |
dispose, disposeequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdisposeprotected static final Logger LOGGER
public static final java.lang.String DYNCLASS_PERSISTENT_NAME
protected DefaultFeatureReferenceSelection.SelectionData selectionData
public DefaultFeatureReferenceSelection(DefaultFeatureStore featureStore) throws DataException
featureStore - the FeatureStore of the selected FeatureReferencesDataException - if there is an error while getting the total number
of Features of the Store.public DefaultFeatureReferenceSelection(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 DefaultFeatureReferenceSelection()
loadFromState(PersistentState) to set the values of the internal
attributes that this class needs to work.public boolean select(FeatureReference reference)
FeatureReferenceSelectionselect in interface FeatureReferenceSelectionreference - the selected feature referencepublic boolean select(FeatureReference reference, boolean undoable)
reference - undoable - if the action must be undoableselect(FeatureReference)public boolean deselect(FeatureReference reference)
FeatureReferenceSelectiondeselect in interface FeatureReferenceSelectionreference - the deselected feature referencepublic boolean deselect(FeatureReference reference, boolean undoable)
reference - undoable - if the action must be undoabledeselect(FeatureReference)public void selectAll()
throws DataException
FeatureReferenceSelectionselectAll in interface FeatureReferenceSelectionDataException - if there is an error selecting all valuespublic void selectAll(boolean undoable)
throws DataException
undoable - if the action must be undoableDataExceptionselectAll()public void deselectAll()
throws DataException
FeatureReferenceSelectiondeselectAll in interface FeatureReferenceSelectionDataException - if there is an error deselecting all valuespublic void deselectAll(boolean undoable)
throws DataException
undoable - if the action must be undoableDataExceptiondeselectAll()public boolean isSelected(FeatureReference reference)
FeatureReferenceSelectionisSelected in interface FeatureReferenceSelectionreference - to checkpublic void reverse()
FeatureReferenceSelectionreverse in interface FeatureReferenceSelectionpublic void reverse(boolean undoable)
undoable - if the action must be undoablereverse()public boolean isEmpty()
public long getSelectedCount()
FeatureReferenceSelectiongetSelectedCount in interface FeatureReferenceSelectionpublic FeatureReferenceIterator referenceIterator()
FeatureReferenceSelectionreferenceIterator in interface FeatureReferenceSelectionpublic java.lang.Iterable<FeatureReference> referenceIterable()
referenceIterable in interface FeatureReferenceSelectionprotected void doDispose()
throws BaseException
AbstractDisposableAbstractDisposable.dispose() method, to be
implemented by child classes.doDispose in class AbstractDisposableBaseExceptionAbstractDisposable.dispose()public boolean isFromStore(DataStore store)
DataSetisFromStore in interface DataSetstore - a DataStorepublic 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 Visitablevisitor - the visitor to apply to each value.BaseException - if there is an error while performing the visitpublic void update(Observable observable, java.lang.Object notification)
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 DefaultFeatureReferenceSelection.SelectionData getData()
public void setData(DefaultFeatureReferenceSelection.SelectionData selectionData)
public java.lang.String toString()
toString in class java.lang.Objectprotected boolean isReversed()
protected void clearFeatureReferences()
public FeatureStore getFeatureStore()
protected FeatureCommandsStack getCommands()
public void saveToState(PersistentState state) throws PersistenceException
PersistentsaveToState in interface PersistentPersistenceExceptionpublic void loadFromState(PersistentState state) throws PersistenceException
PersistentloadFromState in interface PersistentPersistenceExceptionpublic static void registerPersistent()
public void addObserver(Observer observer)
addObserver in interface Observablepublic void beginComplexNotification()
ComplexObservablebeginComplexNotification in interface ComplexObservablepublic void deleteObserver(Observer observer)
deleteObserver in interface Observablepublic void deleteObservers()
deleteObservers in interface Observablepublic void disableNotifications()
ComplexObservabledisableNotifications in interface ComplexObservablepublic void enableNotifications()
ComplexObservableenableNotifications 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 boolean inComplex()
public boolean isEnabledNotifications()
public void notifyObservers()
public void notifyObservers(java.lang.Object arg)
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionpublic boolean isAvailable()
isAvailable in interface FeatureReferenceSelection