commonj.connector.metadata.discovery
Interface MetadataObjectIterator

All Superinterfaces:
Iterator

public interface MetadataObjectIterator
extends Iterator

The iterator used to iterate through the children of a MetadataObject. Implementors can use this interface to optimize the retrieval of large volumes of metadata objects. The iterator can choose to buffer a subset of the results, and only connect to the EIS to retrieve further children when required.

Since:
1.0

Method Summary
 MetadataObject nextMetaDataObject()
          Returns the next MetaDataObject available
 void remove()
          MetadataObjectIterator extends Iteratorand thus inherits the Iterator.remove()method.
 int size()
          Returns the total amount of metadata objects represented by the iterator.
 
Methods inherited from interface java.util.Iterator
hasNext, next
 

Method Detail

nextMetaDataObject

MetadataObject nextMetaDataObject()
                                  throws NoSuchElementException
Returns the next MetaDataObject available

Returns:
the next MetaDataObject in the iteration.
Throws:
NoSuchElementException - iteration has no more MetaDataObject.
See Also:
Iterator.next()

size

int size()
Returns the total amount of metadata objects represented by the iterator. Tool environments can use this method as a convenience to figure out the best way to render the contents of the iterator in a UI. For example, if the size is small the tool may use a simple tree view, but if the size is very large then a scrollable view is a better choice.

Returns:
An integer representing the amount of metadata objects represented by the iterator. If the size cannot be determined upfront, then a value of -1 is returned.

remove

void remove()
MetadataObjectIterator extends Iteratorand thus inherits the Iterator.remove()method. However tool environments must not be allowed to remove MetadataObjects from in the existing MetadataTree. Hence, this method must always throw an UnsupportedOperationExceptionif it is called.

Specified by:
remove in interface Iterator
Throws:
UnsupportedOperationException - is always thrown if the remove is called.
See Also:
Iterator.remove(), MetadataTree