ca.uhn.cache.util
Interface IMutableIterator

All Superinterfaces:
java.util.Iterator
All Known Subinterfaces:
IMutableMergeableIterator
All Known Implementing Classes:
MutableIterator, MutableMergeableIterator

public interface IMutableIterator
extends java.util.Iterator

An extension of Iterator that allows additions during iteration. For example one thread could populate the iterator while another iterates through it.

Version:
$Revision: 1.1 $ updated on $Date: 2005/01/26 00:25:50 $ by $Author: bryan_tripp $
Author:
Bryan Tripp

Method Summary
 void add(java.lang.Object theItem)
          Adds a single item to the list which this iterator iterates through.
 void close()
          Releases any resources held by this iterator.
 void declareException(java.lang.Exception theException)
          This indicates that an exception has been encountered while populating this iterator.
 void freeze()
          Called after all add() and merge() calls.
 
Methods inherited from interface java.util.Iterator
hasNext, next, remove
 

Method Detail

add

public void add(java.lang.Object theItem)
Adds a single item to the list which this iterator iterates through.

Parameters:
theItem - IDataItem to add

freeze

public void freeze()
Called after all add() and merge() calls. The add() and merge() methods may not be called after this. This method MUST be called when additions are complete, or else hasNext() will pend indefinitely. This is because if further additions are possible, hasNext() is undefined.


declareException

public void declareException(java.lang.Exception theException)
This indicates that an exception has been encountered while populating this iterator. A MutableIteratorException wrapping this one will be thrown on the next call to next().

Parameters:
theException - exception to declare

close

public void close()
Releases any resources held by this iterator. Should be called if iteration is being aborted. If called during iteration, the results may be incomplete.



Copyright © 2004-2005 University Health Network. All Rights Reserved.