T - The element in the enumerationpublic class SingletonEnumeration<T> extends Object implements 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 - The element to store in this enumerationpublic void close()
close in interface NamingEnumeration<T>NamingEnumeration.close()public boolean hasMore()
hasMore in interface NamingEnumeration<T>NamingEnumeration.hasMore()public T next()
next in interface NamingEnumeration<T>NamingEnumeration.next()public boolean hasMoreElements()
hasMoreElements in interface Enumeration<T>Enumeration.hasMoreElements()public T nextElement()
nextElement in interface Enumeration<T>Enumeration.nextElement()Copyright © 2003–2019 The Apache Software Foundation. All rights reserved.