public class DynObjectSetRasterInfo extends BaseWeakReferencingObservable implements DynObjectSet, Observer
DynObjectSet.Notification
Constructor and Description |
---|
DynObjectSetRasterInfo()
Creates a new facade over a given info, with fast dynobject
iteration.
|
Modifier and Type | Method and Description |
---|---|
void |
accept(Visitor visitor)
Provides each value of this container to the provided
Visitor . |
void |
accept(Visitor visitor,
long firstValueIndex)
Provides each value of this container to the provided
Visitor ,
beginning from the provided index position. |
void |
addField(String name,
Object object,
int order)
Adds a field to the DynObject
|
void |
delete(DynObject dynObject)
Deletes a DynObject from this set.
|
void |
dispose()
Disposes the current object, to allow it to close and dispose any used
resources.
|
long |
getSize()
Returns the number of
DynObject (s) contained in this
DynObjectSet. |
boolean |
isDeleteEnabled()
Tells if DynObject deletion is enabled into this set.
|
boolean |
isEmpty()
Indicates whether this DynObjectSet contains zero DynObjects.
|
boolean |
isUpdateEnabled()
Tells if DynObject updates are enabled into this set.
|
DisposableIterator |
iterator()
Returns an iterator over the elements in this collection, in the order
(if any) defined when the collection was obtained.
|
DisposableIterator |
iterator(long index)
Returns an iterator over the elements in this collection, in the order
(if any) defined when the collection was obtained.
|
void |
update(DynObject dynObject)
Updates a DynObject from this set.
|
void |
update(Observable observable,
Object notification)
Called whenever a
Observable object is changed and this
Observer has registered on it to receive notifications. |
addObserver, addObserver, addObservers, beginComplexNotification, clearChanged, clone, countObservers, deleteObserver, deleteObserver, deleteObservers, disableNotifications, enableNotifications, endComplexNotification, hasChanged, inComplex, isEnabledNotifications, notify, notifyObservers, notifyObservers, setChanged
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addObserver, deleteObserver, deleteObservers
public DynObjectSetRasterInfo()
public void addField(String name, Object object, int order)
name
- object
- order
- public void dispose()
Disposable
NOTE:After calling this method, the object may not be usable anymore.
dispose
in interface Disposable
public void accept(Visitor visitor, long firstValueIndex) throws BaseException
IndexedVisitable
Visitor
,
beginning from the provided index position.accept
in interface IndexedVisitable
visitor
- the visitor to apply to each value.firstValueIndex
- index of first element to be visited by the Visitor
BaseException
- if there is an error while performing the visitpublic void accept(Visitor visitor) throws BaseException
Visitable
Visitor
.accept
in interface Visitable
visitor
- the visitor to apply to each value.BaseException
- if there is an error while performing the visitpublic long getSize() throws BaseException
DynObjectSet
DynObject
(s) contained in this
DynObjectSet.getSize
in interface DynObjectSet
DynObject
(s) contained in this DynObjectSet.BaseException
public DisposableIterator iterator(long index) throws BaseException
DynObjectSet
NOTE: if you use this method to get the iterator, you
must get sure the iterator is disposed (@see
Disposable.dispose()
) in any case, even if an error occurs
while getting the data. It is recommended to use the accept
methods instead, which handle everything for you.
Take into account the accept methods may use a fast iterator to
get the DynObjects.
iterator
in interface DynObjectSet
index
- index of first element to be returned from the iterator (by a
call to the next method).BaseException
- if the index is out of range (index < 0 || index >
size()).Visitable.accept(org.gvsig.tools.visitor.Visitor)
,
IndexedVisitable.accept(org.gvsig.tools.visitor.Visitor, long)
public DisposableIterator iterator() throws BaseException
DynObjectSet
NOTE: if you use this method to get the iterator, you
must get sure the iterator is disposed (@see
Disposable.dispose()
) in any case, even if an error occurs
while getting the data. It is recommended to use the accept
methods instead, which handle everything for you.
Take into account the accept methods may use a fast iterator to
get the DynObjects.
iterator
in interface DynObjectSet
BaseException
Visitable.accept(org.gvsig.tools.visitor.Visitor)
,
IndexedVisitable.accept(org.gvsig.tools.visitor.Visitor, long)
public boolean isEmpty() throws BaseException
DynObjectSet
isEmpty
in interface DynObjectSet
BaseException
public boolean isDeleteEnabled()
DynObjectSet
isDeleteEnabled
in interface DynObjectSet
public void delete(DynObject dynObject) throws BaseException
DynObjectSet
delete
in interface DynObjectSet
dynObject
- to removeBaseException
- if there is an error removing the DynObjectpublic boolean isUpdateEnabled()
DynObjectSet
isUpdateEnabled
in interface DynObjectSet
public void update(DynObject dynObject) throws BaseException
DynObjectSet
update
in interface DynObjectSet
dynObject
- to updateBaseException
- if there is an error updating the DynObjectpublic void update(Observable observable, 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.