Package javax.wbem

Interface CloseableIterator<E>

  • Type Parameters:
    E - Type parameter.
    All Superinterfaces:
    java.util.Iterator<E>
    All Known Implementing Classes:
    CloseableIteratorDOM, CloseableIteratorGeneric, CloseableIteratorPULL, CloseableIteratorSAX

    public interface CloseableIterator<E>
    extends java.util.Iterator<E>
    A CloseableIterator is a subclass of Iterator that adds support for allowing the underlying implementation to serve up the elements as they become available. The methods hasNext() and next() may block while waiting for elements from the underlying implementation. Since next() or hasNext() can only throw runtime exceptions, if a consumer receives a runtime exception for one of these methods they must call getWBEMException() to get the actual WBEMException.
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      Closes the Iterator.
      WBEMException getWBEMException()
      If next() or hasNext() throws a RuntimeException, this method must be called to get the WBEMException.
      • Methods inherited from interface java.util.Iterator

        forEachRemaining, hasNext, next, remove
    • Method Detail

      • close

        void close()
        Closes the Iterator. This allows the underlying implementation to do any cleanup and disconnect from any source that it may be using.
      • getWBEMException

        WBEMException getWBEMException()
        If next() or hasNext() throws a RuntimeException, this method must be called to get the WBEMException.
        Returns:
        The WBEMException or null if one was not thrown.