org.osjava.sj.jndi
Class ContextBindings

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

public class ContextBindings
extends Object
implements 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

Constructor Summary
ContextBindings(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.
 Object next()
          Returns a Binding created from the next available name.
 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
 

Constructor Detail

ContextBindings

public ContextBindings(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 Enumeration
Returns:
true if there are more elements available, otherwise false

hasMore

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

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

nextElement

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

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

next

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

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

close

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

Specified by:
close in interface NamingEnumeration


Copyright © 2003-2008 OSJava. All Rights Reserved.