public class LargeFeatureReferenceSelection extends AbstractDisposable implements FeatureReferenceSelection
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DYNCLASS_PERSISTENT_NAME |
Constructor and Description |
---|
LargeFeatureReferenceSelection(DefaultFeatureStore featureStore) |
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() |
void |
deleteObserver(Observer observer) |
void |
deleteObservers() |
boolean |
deselect(FeatureReference reference)
Removes a feature from the selection.
|
void |
deselectAll()
Deselects all values.
|
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.
|
FeatureStore |
getFeatureStore() |
java.util.List<FeatureType> |
getFeatureTypes() |
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
|
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() |
java.util.Iterator<FeatureReference> |
referenceIterator()
Returns an unmodifiable Iterator of selected feature references.
|
static void |
registerPersistent() |
void |
reverse()
Reverses the selection.
|
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.
|
void |
selectAll()
Selects all values.
|
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, dispose
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
dispose
public static final java.lang.String DYNCLASS_PERSISTENT_NAME
public LargeFeatureReferenceSelection(DefaultFeatureStore featureStore)
public FeatureStore getFeatureStore()
public boolean select(FeatureReference reference)
FeatureReferenceSelection
select
in interface FeatureReferenceSelection
reference
- the selected feature referencepublic boolean deselect(FeatureReference reference)
FeatureReferenceSelection
deselect
in interface FeatureReferenceSelection
reference
- the deselected feature referencepublic void selectAll() throws DataException
FeatureReferenceSelection
selectAll
in interface FeatureReferenceSelection
DataException
- if there is an error selecting all valuespublic void deselectAll() throws DataException
FeatureReferenceSelection
deselectAll
in interface FeatureReferenceSelection
DataException
- if there is an error deselecting all valuespublic boolean isSelected(FeatureReference reference)
FeatureReferenceSelection
isSelected
in interface FeatureReferenceSelection
reference
- to checkpublic void reverse()
FeatureReferenceSelection
reverse
in interface FeatureReferenceSelection
public boolean isEmpty()
public long getSelectedCount()
FeatureReferenceSelection
getSelectedCount
in interface FeatureReferenceSelection
public java.util.Iterator<FeatureReference> referenceIterator()
FeatureReferenceSelection
referenceIterator
in interface FeatureReferenceSelection
public java.lang.Iterable<FeatureReference> referenceIterable()
referenceIterable
in interface FeatureReferenceSelection
public boolean isAvailable()
isAvailable
in interface FeatureReferenceSelection
public boolean isFromStore(DataStore store)
DataSet
isFromStore
in interface DataSet
store
- a DataStorepublic void accept(Visitor visitor) throws BaseException
DataSet
Visitor
.
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 DataSet
accept
in interface Visitable
visitor
- the visitor to apply to each value.BaseException
- if there is an error while performing the visitprotected void doDispose() throws BaseException
AbstractDisposable
AbstractDisposable.dispose()
method, to be
implemented by child classes.doDispose
in class AbstractDisposable
BaseException
AbstractDisposable.dispose()
public void addObserver(Observer observer)
addObserver
in interface Observable
public void beginComplexNotification()
ComplexObservable
beginComplexNotification
in interface ComplexObservable
public void deleteObserver(Observer observer)
deleteObserver
in interface Observable
public void deleteObservers()
deleteObservers
in interface Observable
public void disableNotifications()
ComplexObservable
disableNotifications
in interface ComplexObservable
public void enableNotifications()
ComplexObservable
enableNotifications
in interface ComplexObservable
public 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 ComplexObservable
public boolean inComplex()
public boolean isEnabledNotifications()
public void notifyObservers()
public void notifyObservers(java.lang.Object arg)
public void update(Observable observable, java.lang.Object notification)
Observer
Observable
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 Observer
s 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 saveToState(PersistentState state) throws PersistenceException
Persistent
saveToState
in interface Persistent
PersistenceException
public void loadFromState(PersistentState state) throws PersistenceException
Persistent
loadFromState
in interface Persistent
PersistenceException
protected void clearFeatureReferences()
public java.util.List<FeatureType> getFeatureTypes()
public static void registerPersistent()