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 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
equals, 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:
close
in interfaceNamingEnumeration<T>
- See Also:
NamingEnumeration.close()
-
hasMore
public boolean hasMore()
- Specified by:
hasMore
in interfaceNamingEnumeration<T>
- See Also:
NamingEnumeration.hasMore()
-
next
public T next()
- Specified by:
next
in interfaceNamingEnumeration<T>
- See Also:
NamingEnumeration.next()
-
hasMoreElements
public boolean hasMoreElements()
- Specified by:
hasMoreElements
in interfaceEnumeration<T>
- See Also:
Enumeration.hasMoreElements()
-
nextElement
public T nextElement()
- Specified by:
nextElement
in interfaceEnumeration<T>
- See Also:
Enumeration.nextElement()
-
-