org.osjava.sj.jndi
Class ContextBindings

java.lang.Object
  extended by org.osjava.sj.jndi.ContextBindings
All Implemented Interfaces:
java.util.Enumeration, javax.naming.NamingEnumeration
Direct Known Subclasses:
ContextNames

public class ContextBindings
extends java.lang.Object
implements javax.naming.NamingEnumeration

This class represents a NamingEnumeration of the bindings of a Context. Originally authored by Henri Yandell and modified to make more flexable with other Context implementations.

Version:
$Rev: 1983 $ $Date: 2005-09-03 07:03:38 -0700 (Sat, 03 Sep 2005) $
Author:
Robert M. Zigweid and Henri Yandell

Field Summary
private  java.util.Map bindings
          A Map of the bindings of a Context.
private  java.util.Iterator iterator
          The iterator utilized in the Enumeration
 
Constructor Summary
ContextBindings(java.util.Map table)
          Creates a ContextBindings object based upon an a Map of names and the objects the names are bound to.
 
Method Summary
 void close()
          Close the ContextBindings instance, rendering it inoperable.
 boolean hasMore()
          Returns true if there are more elements available, otherwise false.
 boolean hasMoreElements()
          Returns true if there are more elements available, otherwise false.
 java.lang.Object next()
          Returns a Binding created from the next available name.
 java.lang.Object nextElement()
          Returns a Binding created from the next available name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bindings

private java.util.Map bindings
A Map of the bindings of a Context.


iterator

private java.util.Iterator iterator
The iterator utilized in the Enumeration

Constructor Detail

ContextBindings

public ContextBindings(java.util.Map table)
Creates a ContextBindings object based upon an a Map of names and the objects the names are bound to. If table is modified after instantiation of ContextBindings, behavior is undefined and should be considered invalid.

Parameters:
table - The table upon which the ContextBindings is based.
Method Detail

hasMoreElements

public boolean hasMoreElements()
Returns true if there are more elements available, otherwise false.

Specified by:
hasMoreElements in interface java.util.Enumeration
Returns:
true if there are more elements available, otherwise false

hasMore

public boolean hasMore()
                throws javax.naming.NamingException
Returns true if there are more elements available, otherwise false.

Specified by:
hasMore in interface javax.naming.NamingEnumeration
Returns:
true if there are more elements available, otherwise false
Throws:
javax.naming.NamingException - if a naming exception is encountered

nextElement

public java.lang.Object nextElement()
Returns a Binding created from the next available name.

Specified by:
nextElement in interface java.util.Enumeration
Returns:
a Binding representing the binding of the name and the object bound to the name

next

public java.lang.Object next()
                      throws javax.naming.NamingException
Returns a Binding created from the next available name.

Specified by:
next in interface javax.naming.NamingEnumeration
Returns:
a Binding representing the binding of the name and the object bound to the name
Throws:
javax.naming.NamingException - if a naming exception occurs

close

public void close()
Close the ContextBindings instance, rendering it inoperable.

Specified by:
close in interface javax.naming.NamingEnumeration