javax.naming
public interface NamingEnumeration<T> extends Enumeration<T>
The specific type of enumeration that supports throwing various exceptions by
the hasMore method. The exceptions are only thrown if the enumeration is
scanned using next()
and hasMore()
. If the inherited
Enumeration.nextElement()
and
Enumeration.hasMoreElements()
are used instead, the exceptions are
not throwed, and the enumeration is just iterated over available elements.
This enumeration becomes invalid after throwing the exception. If the exception has been thrown, not other method should be called of that enumeration.
Modifier and Type | Method and Description |
---|---|
void |
close()
Immediately frees all resources, owned by this enumeration.
|
boolean |
hasMore()
Checks if there are more unvisited elements in the enumeration, throwing
exceptions if there are some unvisited, but not available elements.
|
T |
next()
Returns the next element in this enumeration.
|
hasMoreElements, nextElement
T next() throws NamingException
NamingException
boolean hasMore() throws NamingException
PartialResultException
- if the enumeration, returned by the
Context.list(Name)
or other similar method contains only
partial answer.SizeLimitExceededException
- if remaining elements are not available
because of the previously specified size limit.NamingException
void close() throws NamingException
NamingException