public class SingletonEnumeration<T>
extends java.lang.Object
implements javax.naming.NamingEnumeration<T>
| Modifier and Type | Field and Description |
|---|---|
private T |
element
The singleton element to return
|
private boolean |
hasMore
Can we return a element
|
| Constructor and Description |
|---|
SingletonEnumeration(T element)
Creates a NamingEnumeration over a single element.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Makes calls to hasMore to false even if we had more.
|
boolean |
hasMore() |
boolean |
hasMoreElements() |
T |
next() |
T |
nextElement() |
private final T element
private boolean hasMore
public SingletonEnumeration(T element)
element - TODOpublic void close()
close in interface javax.naming.NamingEnumeration<T>NamingEnumeration.close()public boolean hasMore()
hasMore in interface javax.naming.NamingEnumeration<T>NamingEnumeration.hasMore()public T next()
next in interface javax.naming.NamingEnumeration<T>NamingEnumeration.next()public boolean hasMoreElements()
hasMoreElements in interface java.util.Enumeration<T>Enumeration.hasMoreElements()