org.objectweb.easybeans.naming.context
Class NamingEnumerationImpl

java.lang.Object
  extended by org.objectweb.easybeans.naming.context.NamingEnumerationImpl
All Implemented Interfaces:
java.util.Enumeration<javax.naming.NameClassPair>, javax.naming.NamingEnumeration<javax.naming.NameClassPair>

public class NamingEnumerationImpl
extends java.lang.Object
implements javax.naming.NamingEnumeration<javax.naming.NameClassPair>

Implementation of the NamingEnumeration for list operations Each element is of type NameClassPair.

Author:
Florent Benoit

Field Summary
private  java.util.Hashtable bindings
          List of bindings.
private  java.util.Enumeration names
          list of names.
 
Constructor Summary
NamingEnumerationImpl(java.util.Hashtable bindings)
          Constructor.
 
Method Summary
 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.
 javax.naming.NameClassPair next()
          Retrieves the next element in the enumeration.
 javax.naming.NameClassPair 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

names

private java.util.Enumeration names
list of names.


bindings

private java.util.Hashtable bindings
List of bindings.

Constructor Detail

NamingEnumerationImpl

NamingEnumerationImpl(java.util.Hashtable bindings)
Constructor. Called by list()

Parameters:
bindings - list of bindings
Method Detail

hasMore

public boolean hasMore()
                throws javax.naming.NamingException
Determines whether there are any more elements in the enumeration.

Specified by:
hasMore in interface javax.naming.NamingEnumeration<javax.naming.NameClassPair>
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.

next

public javax.naming.NameClassPair next()
                                throws javax.naming.NamingException
Retrieves the next element in the enumeration.

Specified by:
next in interface javax.naming.NamingEnumeration<javax.naming.NameClassPair>
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).
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.

close

public void close()
Closes this enumeration.

Specified by:
close in interface javax.naming.NamingEnumeration<javax.naming.NameClassPair>

nextElement

public javax.naming.NameClassPair 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<javax.naming.NameClassPair>
Returns:
the next element of this enumeration.

hasMoreElements

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

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