Engineering Full Stack Apps with Java and JavaScript
List is an ordered collection.
also known as a sequence.
typically allow duplicate
typically allow multiple null elements if they allow null elements at all.
Places additional stipulations on the contracts of the iterator, add, remove, equals, and hashCode methods.
While it is permissible for lists to contain themselves as elements, extreme caution is advised: the equals and hashCode methods are no longer well defined on such a list.
AbstractList
AbstractSequentialList
ArrayList
AttributeList
CopyOnWriteArrayList
LinkedList
RoleList
RoleUnresolvedList
Stack
Vector
add(E e)
Appends the specified element to the end of this list
add(int index, E element)
Add at specified index
addAll(Collection<? extends E> c)
Add all from specified collection
addAll(int index, Collection<? extends E> c)
Add all at specified index
clear()
clear collection
contains(Object o)
if o is present
containsAll(Collection<?> c)
if this collection contains all of the elements in the specified collection.
equals(Object o)
Check if meaningfully equal
get(int index)
returns element at index
hashCode()
return hash code integer
indexOf(Object o)
returns index of o
isEmpty()
Check if empty
iterator()
return an iterator
lastIndexOf(Object o)
returns index of last occurrence of o
listIterator()
returns a list iterator
listIterator(int index)
returns a list iterator starting at the specified index
remove(Object o)
Remove o
removeAll(Collection<?> c)
Remove all elements present in the specified collection
retainAll(Collection<?> c)
Retains only the elements in this collection that are contained in the specified collection
set(int index, E element)
replaces the element at the specified position in this list with the specified element
size()
size of the collection
subList(int fromIndex, int toIndex)
returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.
returned list is backed by this list, so non-structural changes in the returned list are reflected in this list, and vice-versa.
toArray()
convert to an array
toArray(T[] a)
runtime type of the returned array is that of the specified array.