public class MultiDynObjectSet extends java.lang.Object implements DynObjectSet
DynObjectSet
s as if they were an only contiguous
set of DynObject
s.Modifier and Type | Class and Description |
---|---|
static class |
MultiDynObjectSet.MultiDynObjectSetDisposableIterator |
DynObjectSet.Notification
EMPTY_DYNOBJECTSET
Constructor and Description |
---|
MultiDynObjectSet(DynObjectSet[] innerSets)
Creates a new
MultiDynObjectSet with the list of
DynObjectSet s to façade. |
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 |
addObserver(Observer o) |
void |
delete(DynObject dynObject)
Deletes a DynObject from this set.
|
void |
deleteObserver(Observer o) |
void |
deleteObservers() |
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.
|
public MultiDynObjectSet(DynObjectSet[] innerSets)
MultiDynObjectSet
with the list of
DynObjectSet
s to façade.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
next
method. An initial call to the
previous
method would return the element with the specified
index minus one.
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 void addObserver(Observer o)
addObserver
in interface Observable
public void deleteObserver(Observer o)
deleteObserver
in interface Observable
public void deleteObservers()
deleteObservers
in interface Observable
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 DynObject