org.jaxen.util
Class SingletonList
AbstractListorg.jaxen.util.SingletonList
public class SingletonList
extends AbstractList
A utility class that implements singleton lists
(to avoid dependency on JDK 1.3). Many operations
including add() and remove() throw
UnsupportedOperationExceptions.
Object | get(int index)- Returns the single element in the list.
|
int | size()- Returns 1.
|
element
private final Object element
SingletonList
public SingletonList(Object element)
Creates a new singleton list.
element - the single member of the list
get
public Object get(int index)
Returns the single element in the list.
- the only element in the list
size
public int size()
Returns 1.