public class SingletonList extends AbstractList
add()
and remove()
throw
UnsupportedOperationExceptions.modCount
Constructor and Description |
---|
SingletonList(Object element)
Creates a new singleton list.
|
Modifier and Type | Method and Description |
---|---|
Object |
get(int index)
Returns the single element in the list.
|
int |
size()
Returns 1.
|
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
parallelStream, removeIf, stream
public SingletonList(Object element)
element
- the single member of the listpublic int size()
size
in interface Collection
size
in interface List
size
in class AbstractCollection
public Object get(int index)
get
in interface List
get
in class AbstractList
IndexOutOfBoundsException
- if index is not 0Copyright 2001–2022 The Jaxen Project. All rights reserved.