public class SingletonList
extends java.util.AbstractList
add() and remove() throw
UnsupportedOperationExceptions.| Constructor | Description |
|---|---|
SingletonList(java.lang.Object element) |
Creates a new singleton list.
|
| Modifier and Type | Method | Description |
|---|---|---|
java.lang.Object |
get(int index) |
Returns the single element in the list.
|
int |
size() |
Returns 1.
|
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toStringadd, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subListpublic SingletonList(java.lang.Object element)
element - the single member of the listpublic int size()
size in class java.util.AbstractCollectionpublic java.lang.Object get(int index)
get in class java.util.AbstractListjava.lang.IndexOutOfBoundsException - if index is not 0Copyright © 2001–2018 Codehaus. All rights reserved.