public interface List extends Collection
(J2SE)
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
java.lang.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(java.lang.Object o)
Returns true if this list contains the specified element.
|
java.lang.Object |
get(int index)
Returns the element at the specified position in this list.
|
int |
indexOf(java.lang.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.
|
java.lang.Object |
remove(int index)
Removes the element at the specified position in this list.
|
void add(int index, java.lang.Object o)
void clear()
boolean contains(java.lang.Object o)
o
- element whose presence in this list is to be tested.java.lang.Object get(int index)
index
- index of element to return.java.lang.IndexOutOfBoundsException
- if the index is out of range
(index < 0 || index >= size()).int indexOf(java.lang.Object o)
o
- element to search for.java.lang.Object remove(int index)
index
- the index of the element to removed.java.lang.IndexOutOfBoundsException
- if the index is out of range
(index < 0 || index >= size()).