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, subListaddAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddAll, contains, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArrayparallelStream, removeIf, streampublic SingletonList(Object element)
element - the single member of the listpublic int size()
size in interface Collectionsize in interface Listsize in class AbstractCollectionpublic Object get(int index)
get in interface Listget in class AbstractListIndexOutOfBoundsException - if index is not 0Copyright 2001–2022 The Jaxen Project. All rights reserved.