public final class

LazySearchEnumerationImpl

extends Object
implements NamingEnumeration<T>
java.lang.Object
   ↳ com.sun.jndi.toolkit.dir.LazySearchEnumerationImpl

Summary

Public Constructors
LazySearchEnumerationImpl(NamingEnumeration candidates, AttrFilter filter, SearchControls cons)
LazySearchEnumerationImpl(NamingEnumeration candidates, AttrFilter filter, SearchControls cons, Context ctx, Hashtable env, boolean useFactory)
LazySearchEnumerationImpl(NamingEnumeration candidates, AttrFilter filter, SearchControls cons, Context ctx, Hashtable env)
Public Methods
void close()
Closes this enumeration.
boolean hasMore()
Determines whether there are any more elements in the enumeration.
boolean hasMoreElements()
Tests if this enumeration contains more elements.
Object next()
Retrieves the next element in the enumeration.
Object nextElement()
Returns the next element of this enumeration if this enumeration object has at least one more element to provide.
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.util.Enumeration
From interface javax.naming.NamingEnumeration

Public Constructors

public LazySearchEnumerationImpl (NamingEnumeration candidates, AttrFilter filter, SearchControls cons)

public LazySearchEnumerationImpl (NamingEnumeration candidates, AttrFilter filter, SearchControls cons, Context ctx, Hashtable env, boolean useFactory)

public LazySearchEnumerationImpl (NamingEnumeration candidates, AttrFilter filter, SearchControls cons, Context ctx, Hashtable env)

Public Methods

public void close ()

Closes this enumeration. After this method has been invoked on this enumeration, the enumeration becomes invalid and subsequent invocation of any of its methods will yield undefined results. This method is intended for aborting an enumeration to free up resources. If an enumeration proceeds to the end--that is, until hasMoreElements() or hasMore() returns false-- resources will be freed up automatically and there is no need to explicitly call close().

This method indicates to the service provider that it is free to release resources associated with the enumeration, and can notify servers to cancel any outstanding requests. The close() method is a hint to implementations for managing their resources. Implementations are encouraged to use appropriate algorithms to manage their resources when client omits the close() calls.

public boolean hasMore ()

Determines whether there are any more elements in the enumeration. This method allows naming exceptions encountered while determining whether there are more elements to be caught and handled by the application.

Returns
  • true if there is more in the enumeration ; false otherwise.

public boolean hasMoreElements ()

Tests if this enumeration contains more elements.

Returns
  • true if and only if this enumeration object contains at least one more element to provide; false otherwise.

public Object next ()

Retrieves the next element in the enumeration. This method allows naming exceptions encountered while retrieving the next element to be caught and handled by the application.

Note that next() can also throw the runtime exception NoSuchElementException to indicate that the caller is attempting to enumerate beyond the end of the enumeration. This is different from a NamingException, which indicates that there was a problem in obtaining the next element, for example, due to a referral or server unavailability, etc.

Returns
  • The possibly null element in the enumeration. null is only valid for enumerations that can return null (e.g. Attribute.getAll() returns an enumeration of attribute values, and an attribute value can be null).

public Object nextElement ()

Returns the next element of this enumeration if this enumeration object has at least one more element to provide.

Returns
  • the next element of this enumeration.