org.objectweb.easybeans.naming.context
Class BindingsImpl

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

public class BindingsImpl
extends java.lang.Object
implements javax.naming.NamingEnumeration<javax.naming.Binding>

Implementation of the NamingEnumeration for Context.listBindings operations.

Author:
Florent Benoit

Field Summary
private  java.util.Hashtable bindings
          List of bindings.
private  java.util.Enumeration names
          list of names.
 
Constructor Summary
BindingsImpl(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.Binding next()
          It returns a Binding instead of a NameClassPair * Retrieves the next element in the enumeration.
 javax.naming.Binding 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

BindingsImpl

public BindingsImpl(java.util.Hashtable bindings)
Constructor.

Parameters:
bindings - list of bindings
Method Detail

next

public javax.naming.Binding next()
                          throws javax.naming.NamingException
It returns a Binding instead of a NameClassPair * Retrieves the next element in the enumeration.

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

nextElement

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

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.Binding>
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.

close

public void close()
Closes this enumeration.

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

hasMoreElements

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

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