org.apache.directory.shared.ldap.util
Class SingletonEnumeration<T>

java.lang.Object
  extended by org.apache.directory.shared.ldap.util.SingletonEnumeration<T>
All Implemented Interfaces:
java.util.Enumeration<T>, javax.naming.NamingEnumeration<T>

public class SingletonEnumeration<T>
extends java.lang.Object
implements javax.naming.NamingEnumeration<T>

A NamingEnumeration over a single element.

Version:
$Revision: 575496 $
Author:
Apache Directory Project

Constructor Summary
SingletonEnumeration(T element)
          Creates a NamingEnumeration over a single element.
 
Method Summary
 void close()
          Makes calls to hasMore to false even if we had more.
 boolean hasMore()
           
 boolean hasMoreElements()
           
 T next()
           
 T nextElement()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingletonEnumeration

public SingletonEnumeration(T element)
Creates a NamingEnumeration over a single element.

Parameters:
element - TODO
Method Detail

close

public void close()
Makes calls to hasMore to false even if we had more.

Specified by:
close in interface javax.naming.NamingEnumeration<T>
See Also:
NamingEnumeration.close()

hasMore

public boolean hasMore()
Specified by:
hasMore in interface javax.naming.NamingEnumeration<T>
See Also:
NamingEnumeration.hasMore()

next

public T next()
Specified by:
next in interface javax.naming.NamingEnumeration<T>
See Also:
NamingEnumeration.next()

hasMoreElements

public boolean hasMoreElements()
Specified by:
hasMoreElements in interface java.util.Enumeration<T>
See Also:
Enumeration.hasMoreElements()

nextElement

public T nextElement()
Specified by:
nextElement in interface java.util.Enumeration<T>
See Also:
Enumeration.nextElement()


Copyright © 2003-2009 Apache Software Foundation. All Rights Reserved.