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, toStringpublic 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-2012 Codehaus. All Rights Reserved.