Home about services products contact login
   com.smardec.jndi

MirrorJNDI

  mirror
com.smardec.jndi.mirror
Class AbstractNamingEnumeration

java.lang.Object
|
+--com.smardec.jndi.mirror.AbstractNamingEnumeration
All Implemented Interfaces:
java.util.Enumeration, javax.naming.NamingEnumeration
Direct Known Subclasses:
MirrorCtx.BindingsEnumeration, MirrorCtx.NamesEnumeration

public abstract class AbstractNamingEnumeration
extends java.lang.Object
implements javax.naming.NamingEnumeration

AbstractNamingEnumeration is basic implementation of NamingEnumeration.


Field Summary
protected java.util.Enumeration originalEnumeration
Original Enumeration
Constructor Summary
protected AbstractNamingEnumeration()
Creates AbstractNamingEnumeration object.
Method Summary
void close()
Closes enumeration.
boolean hasMore()
Determines whether there are any more elements in the enumeration.
boolean hasMoreElements()
Tests if this enumeration contains more elements.
abstract java.lang.Object next()
Retrieves the next element in the enumeration.
java.lang.Object nextElement()
Returns the next element of this enumeration if this enumeration object has at least one more element to provide.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail
originalEnumeration
protected java.util.Enumeration originalEnumeration

Original Enumeration

Constructor Detail
AbstractNamingEnumeration
protected AbstractNamingEnumeration()
Creates AbstractNamingEnumeration object.

Method Detail
close
public void close()
Closes enumeration. The method does nothing.

Specified by:
close in interface javax.naming.NamingEnumeration

hasMore
public boolean hasMore() throws javax.naming.NamingException
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.

Specified by:
hasMore in interface javax.naming.NamingEnumeration
Returns:
true If there is more in the enumeration; false otherwise.
Throws:
javax.naming.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.

hasMoreElements
public boolean hasMoreElements()
Tests if this enumeration contains more elements.

Specified by:
hasMoreElements in interface java.util.Enumeration
Returns:
true if and only if this enumeration object contains at least one more element to provide; false otherwise.

next
public abstract java.lang.Object next() throws javax.naming.NamingException
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.

Specified by:
next in interface javax.naming.NamingEnumeration
Returns:
The possibly null element in the enumeration. null is only valid for enumerations that can return null.
Throws:
javax.naming.NamingException - If a naming exception is encountered while attempting to retrieve the next element. See NamingException and its subclasses for the possible naming exceptions.
java.util.NoSuchElementException - If attempting to get the next element when none is available.

nextElement
public java.lang.Object nextElement()
Returns the next element of this enumeration if this enumeration object has at least one more element to provide.

Specified by:
nextElement in interface java.util.Enumeration
Returns:
The next element of this enumeration.
Throws:
java.util.NoSuchElementException - If no more elements exist.
Home about services products contact login