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>
ACloseableIterator
is a subclass ofIterator
that adds support for allowing the underlying implementation to serve up the elements as they become available. The methodshasNext()
andnext()
may block while waiting for elements from the underlying implementation. Sincenext()
orhasNext()
can only throw runtime exceptions, if a consumer receives a runtime exception for one of these methods they must callgetWBEMException()
to get the actualWBEMException
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Closes theIterator
.WBEMException
getWBEMException()
Ifnext()
orhasNext()
throws aRuntimeException
, this method must be called to get theWBEMException
.
-
-
-
Method Detail
-
close
void close()
Closes theIterator
. This allows the underlying implementation to do any cleanup and disconnect from any source that it may be using.
-
getWBEMException
WBEMException getWBEMException()
Ifnext()
orhasNext()
throws aRuntimeException
, this method must be called to get theWBEMException
.- Returns:
- The
WBEMException
or null if one was not thrown.
-
-