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, toString
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
public SingletonList(java.lang.Object element)
element
- the single member of the listpublic int size()
size
in class java.util.AbstractCollection
public java.lang.Object get(int index)
get
in class java.util.AbstractList
java.lang.IndexOutOfBoundsException
- if index is not 0Copyright © 2001–2018 Codehaus. All rights reserved.