Package org.apache.directory.api.util
Class SingletonEnumeration<T>
- java.lang.Object
-
- org.apache.directory.api.util.SingletonEnumeration<T>
-
- Type Parameters:
T- The element in the enumeration
- All Implemented Interfaces:
Enumeration<T>,NamingEnumeration<T>
public class SingletonEnumeration<T> extends Object implements NamingEnumeration<T>
A NamingEnumeration over a single element.- Author:
- Apache Directory Project
-
-
Constructor Summary
Constructors Constructor Description SingletonEnumeration(T element)Creates a NamingEnumeration over a single element.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Makes calls to hasMore to false even if we had more.booleanhasMore()booleanhasMoreElements()Tnext()TnextElement()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Enumeration
asIterator
-
-
-
-
Constructor Detail
-
SingletonEnumeration
public SingletonEnumeration(T element)
Creates a NamingEnumeration over a single element.- Parameters:
element- The element to store in this enumeration
-
-
Method Detail
-
close
public void close()
Makes calls to hasMore to false even if we had more.- Specified by:
closein interfaceNamingEnumeration<T>- See Also:
NamingEnumeration.close()
-
hasMore
public boolean hasMore()
- Specified by:
hasMorein interfaceNamingEnumeration<T>- See Also:
NamingEnumeration.hasMore()
-
next
public T next()
- Specified by:
nextin interfaceNamingEnumeration<T>- See Also:
NamingEnumeration.next()
-
hasMoreElements
public boolean hasMoreElements()
- Specified by:
hasMoreElementsin interfaceEnumeration<T>- See Also:
Enumeration.hasMoreElements()
-
nextElement
public T nextElement()
- Specified by:
nextElementin interfaceEnumeration<T>- See Also:
Enumeration.nextElement()
-
-