public interface List extends Collection
(J2SE)
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
Object o)
Inserts the specified element at the specified position in this list
|
void |
clear()
Removes all of the elements from this list (optional operation).
|
boolean |
contains(Object o)
Returns true if this list contains the specified element.
|
Object |
get(int index)
Returns the element at the specified position in this list.
|
int |
indexOf(Object o)
Returns the index in this list of the first occurrence of the specified
element, or -1 if this list does not contain this element.
|
Object |
remove(int index)
Removes the element at the specified position in this list.
|
void add(int index, Object o)
void clear()
boolean contains(Object o)
o
- element whose presence in this list is to be tested.Object get(int index)
index
- index of element to return.IndexOutOfBoundsException
- if the index is out of range
(index < 0 || index >= size()).int indexOf(Object o)
o
- element to search for.Object remove(int index)
index
- the index of the element to removed.IndexOutOfBoundsException
- if the index is out of range
(index < 0 || index >= size()).