org.gvsig.tools.dynobject
Interface DynObjectSet

All Superinterfaces:
Disposable, IndexedVisitable, Observable, Visitable
All Known Implementing Classes:
MultiDynObjectSet

public interface DynObjectSet
extends Disposable, IndexedVisitable, Observable

A set of iterable DynObject objects.

Author:
2010- César Ordiñana - gvSIG team

Nested Class Summary
static interface DynObjectSet.Notification
           
 
Method Summary
 void delete(DynObject dynObject)
          Deletes a DynObject from this set.
 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.
 
Methods inherited from interface org.gvsig.tools.dispose.Disposable
dispose
 
Methods inherited from interface org.gvsig.tools.visitor.IndexedVisitable
accept
 
Methods inherited from interface org.gvsig.tools.visitor.Visitable
accept
 
Methods inherited from interface org.gvsig.tools.observer.Observable
addObserver, deleteObserver, deleteObservers
 

Method Detail

getSize

long getSize()
             throws BaseException
Returns the number of DynObject(s) contained in this DynObjectSet.

Returns:
number of DynObject(s) contained in this DynObjectSet.
Throws:
BaseException

iterator

DisposableIterator iterator(long index)
                            throws BaseException
Returns an iterator over the elements in this collection, in the order (if any) defined when the collection was obtained. The iterator starts at the specified position in this collection. The specified index indicates the first element that would be returned by an initial call to the 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.

Parameters:
index - index of first element to be returned from the iterator (by a call to the next method).
Returns:
an iterator of the elements in this collection (in proper sequence), starting at the specified position in the collection.
Throws:
BaseException - if the index is out of range (index < 0 || index > size()).
See Also:
Visitable.accept(org.gvsig.tools.visitor.Visitor), IndexedVisitable.accept(org.gvsig.tools.visitor.Visitor, long)

iterator

DisposableIterator iterator()
                            throws BaseException
Returns an iterator over the elements in this collection, in the order (if any) defined when the collection was obtained.

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.

Returns:
an iterator of the elements in this collection (in proper sequence).
Throws:
BaseException
See Also:
Visitable.accept(org.gvsig.tools.visitor.Visitor), IndexedVisitable.accept(org.gvsig.tools.visitor.Visitor, long)

isEmpty

boolean isEmpty()
                throws BaseException
Indicates whether this DynObjectSet contains zero DynObjects.

Returns:
true if this DynObjectSet is empty, false otherwise.
Throws:
BaseException

isDeleteEnabled

boolean isDeleteEnabled()
Tells if DynObject deletion is enabled into this set.

Returns:
if DynObject deletion is enabled into this set

delete

void delete(DynObject dynObject)
            throws BaseException
Deletes a DynObject from this set. Depending on the inner set implementation that may mean also the data will be removed from a persistent state.

Parameters:
dynObject - to remove
Throws:
BaseException - if there is an error removing the DynObject

isUpdateEnabled

boolean isUpdateEnabled()
Tells if DynObject updates are enabled into this set.

Returns:
if DynObject updates are enabled into this set

update

void update(DynObject dynObject)
            throws BaseException
Updates a DynObject from this set. Depending on the inner set implementation that may mean also the data will be updated in a persistent state.

Parameters:
dynObject - to update
Throws:
BaseException - if there is an error updating the DynObject


Copyright © 2004-2011 gvSIG. All Rights Reserved.