|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.ArrayList<E>
E
- type of the elementspublic class ArrayList<E>
An expandable array.
Field Summary | |
---|---|
protected int |
modCount
|
Constructor Summary | |
---|---|
ArrayList()
Create an array list. |
|
ArrayList(Collection<? extends E> c)
|
|
ArrayList(E[] elements)
Deprecated. not in JDK |
|
ArrayList(int initialCapacity)
Create an array list. |
Method Summary | ||
---|---|---|
boolean |
add(E element)
Add a element at the end of the array list. |
|
void |
add(int index,
E element)
Add a element at a specific index. |
|
boolean |
addAll(Collection<? extends E> c)
|
|
void |
addAll(E[] elements)
Deprecated. not in JDK |
|
boolean |
addAll(int index,
Collection<? extends E> c)
|
|
void |
addAll(int index,
E[] elements)
Deprecated. not in JDK |
|
void |
clear()
Clear the array list. |
|
boolean |
contains(Object o)
|
|
boolean |
containsAll(Collection<?> c)
|
|
void |
ensureCapacity(int minCapacity)
Ensure that we have sufficient capacity in the array to store the requested number of elements. |
|
boolean |
equals(Object o)
|
|
E |
get(int index)
Get a specific element. |
|
int |
indexOf(Object element)
Get the first index of a specific element. |
|
boolean |
isEmpty()
|
|
Iterator<E> |
iterator()
|
|
int |
lastIndexOf(Object element)
Get the last index of a specific element. |
|
ListIterator<E> |
listIterator()
|
|
ListIterator<E> |
listIterator(int index)
|
|
E |
remove(int index)
Remove a element at a specific index. |
|
boolean |
remove(Object o)
|
|
boolean |
removeAll(Collection<?> c)
|
|
protected void |
removeRange(int start,
int end)
|
|
boolean |
retainAll(Collection<?> c)
|
|
E |
set(int index,
E element)
Replace an element at a specific index with a new element. |
|
int |
size()
Get the number of elements in this array list. |
|
List<E> |
subList(int start,
int end)
|
|
Object[] |
toArray()
|
|
|
toArray(T[] dest)
|
|
void |
trimToSize()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Collection |
---|
containsAll, hashCode, isEmpty, removeAll, retainAll, toArray, toArray |
Field Detail |
---|
protected transient int modCount
Constructor Detail |
---|
public ArrayList()
public ArrayList(Collection<? extends E> c)
public ArrayList(int initialCapacity)
initialCapacity
- The initial size of the array list.@Deprecated public ArrayList(E[] elements)
elements
- The initial elements in the array list.Method Detail |
---|
public void add(int index, E element)
add
in interface List<E>
index
- The index at which the element should be added.element
- The element to add.public boolean add(E element)
add
in interface Collection<E>
element
- The element to add.@Deprecated public void addAll(E[] elements)
elements
- The array of elements to add.@Deprecated public void addAll(int index, E[] elements)
index
- The index to start adding elements.elements
- The array of elements to add.public boolean addAll(Collection<? extends E> c)
addAll
in interface Collection<E>
public boolean addAll(int index, Collection<? extends E> c)
addAll
in interface List<E>
public void clear()
clear
in interface Collection<E>
public void ensureCapacity(int minCapacity)
minCapacity
- public E get(int index)
get
in interface List<E>
index
- The index of the wanted element.
public int indexOf(Object element)
indexOf
in interface List<E>
element
- The wanted element.
public int lastIndexOf(Object element)
lastIndexOf
in interface List<E>
element
- The wanted element.
public E remove(int index)
remove
in interface List<E>
index
- The index of the element to remove.
public boolean remove(Object o)
remove
in interface Collection<E>
protected void removeRange(int start, int end)
public E set(int index, E element)
set
in interface List<E>
index
- The index of the element to set.element
- The new element.
public int size()
size
in interface Collection<E>
public ListIterator<E> listIterator(int index)
listIterator
in interface List<E>
public List<E> subList(int start, int end)
subList
in interface List<E>
public void trimToSize()
public boolean contains(Object o)
contains
in interface Collection<E>
public boolean equals(Object o)
equals
in interface Collection<E>
equals
in class Object
public Iterator<E> iterator()
iterator
in interface Iterable<E>
iterator
in interface Collection<E>
public ListIterator<E> listIterator()
listIterator
in interface List<E>
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<E>
public boolean isEmpty()
isEmpty
in interface Collection<E>
public boolean removeAll(Collection<?> c)
removeAll
in interface Collection<E>
public boolean retainAll(Collection<?> c)
retainAll
in interface Collection<E>
public Object[] toArray()
toArray
in interface Collection<E>
public <T> T[] toArray(T[] dest)
toArray
in interface Collection<E>
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |