APIdia Launch Partner
Top Description Fields Constructors Methods
com.sun.jndi.toolkit.dir

public Class ContextEnumerator

extends Object
implements NamingEnumeration<Binding>
Class Inheritance
All Implemented Interfaces
javax.naming.NamingEnumeration, java.util.Enumeration
Known Direct Subclasses
com.sun.jndi.toolkit.dir.HierMemDirCtx.HierContextEnumerator
Imports
javax.naming.*, javax.naming.directory.SearchControls, java.util.*

A class for recursively enumerating the contents of a Context;
Author
Jon Ruiz

Field Summary

Modifier and TypeField and Description
private NamingEnumeration<Binding>
private String
private Binding
private ContextEnumerator
private boolean
private boolean
private static boolean
private Context
private boolean
private int

Constructor Summary

AccessConstructor and Description
public
public
ContextEnumerator(Context context, int scope)

protected
ContextEnumerator(Context context, int scope, String contextName, boolean returnSelf)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Implements javax.naming.NamingEnumeration.close.

Closes this enumeration.

protected NamingEnumeration<Binding>
private Binding
private Binding
public boolean
hasMore()

Implements javax.naming.NamingEnumeration.hasMore.

Determines whether there are any more elements in the enumeration.

private boolean
private boolean
public boolean
hasMoreElements()

Implements java.util.Enumeration.hasMoreElements.

Tests if this enumeration contains more elements.

protected ContextEnumerator
newEnumerator(Context ctx, int scope, String contextName, boolean returnSelf)

public Binding
next()

Implements javax.naming.NamingEnumeration.next.

Retrieves the next element in the enumeration.

public Binding
nextElement()

Implements java.util.Enumeration.nextElement.

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

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

childrenback to summary
private NamingEnumeration<Binding> children
contextNameback to summary
private String contextName
currentChildback to summary
private Binding currentChild
currentChildEnumback to summary
private ContextEnumerator currentChildEnum
currentChildExpandedback to summary
private boolean currentChildExpanded
currentReturnedback to summary
private boolean currentReturned
debugback to summary
private static boolean debug
rootback to summary
private Context root
rootProcessedback to summary
private boolean rootProcessed
scopeback to summary
private int scope

Constructor Detail

ContextEnumeratorback to summary
public ContextEnumerator(Context context) throws NamingException
ContextEnumeratorback to summary
public ContextEnumerator(Context context, int scope) throws NamingException
ContextEnumeratorback to summary
protected ContextEnumerator(Context context, int scope, String contextName, boolean returnSelf) throws NamingException

Method Detail

closeback to summary
public void close() throws NamingException

Implements javax.naming.NamingEnumeration.close.

Doc from javax.naming.NamingEnumeration.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.

Exceptions
NamingException:
If a naming exception is encountered while closing the enumeration.
getImmediateChildrenback to summary
protected NamingEnumeration<Binding> getImmediateChildren(Context ctx) throws NamingException
getNextChildback to summary
private Binding getNextChild() throws NamingException
getNextDescendantback to summary
private Binding getNextDescendant() throws NamingException
hasMoreback to summary
public boolean hasMore() throws NamingException

Implements javax.naming.NamingEnumeration.hasMore.

Doc from javax.naming.NamingEnumeration.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.

Exceptions
NamingException:
If a naming exception is encountered while attempting to determine whether there is another element in the enumeration. See NamingException and its subclasses for the possible naming exceptions.
hasMoreChildrenback to summary
private boolean hasMoreChildren() throws NamingException
hasMoreDescendantsback to summary
private boolean hasMoreDescendants() throws NamingException
hasMoreElementsback to summary
public boolean hasMoreElements()

Implements java.util.Enumeration.hasMoreElements.

Doc from java.util.Enumeration.hasMoreElements.

Tests if this enumeration contains more elements.

newEnumeratorback to summary
protected ContextEnumerator newEnumerator(Context ctx, int scope, String contextName, boolean returnSelf) throws NamingException
nextback to summary
public Binding next() throws NamingException

Implements javax.naming.NamingEnumeration.next.

Doc from javax.naming.NamingEnumeration.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.

Exceptions
NamingException:
If a naming exception is encountered while attempting to retrieve the next element. See NamingException and its subclasses for the possible naming exceptions.
nextElementback to summary
public Binding nextElement()

Implements java.util.Enumeration.nextElement.

Doc from java.util.Enumeration.nextElement.

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

prepNextChildback to summary
private void prepNextChild() throws NamingException