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 {@link #next()} and {@link #hasMore()}. If the inherited {@link java.util.Enumeration#nextElement()} and {@link 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.
Method Summary | |
---|---|
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. |
Throws: NamingException
Returns: true if there are some unvisited elements, false otherwise.
Throws: PartialResultException if the enumeration, returned by the {@link 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
Returns: the next element of this enumeration
Throws: NamingException