Extracted from the
Modifier and Type | Method and Description |
---|---|
boolean |
add(E e)
Appends the specified element to the end of this
list. (Always returns
true .) |
void |
add(int index,
E element)
Inserts the specified element at the specified position in this
list.
|
void |
clear()
Removes all of the elements from this list.
|
boolean |
contains(E o)
Returns true if this list contains the specified element.
|
E |
get(int index)
Returns the element at the specified position in this list.
|
int |
indexOf(E o)
Returns the index of the first occurrence of the specified element
in this list, or -1 if this list does not contain the element.
|
boolean |
isEmpty()
Returns true if this list contains no elements.
|
Iterator<E> |
iterator()
Returns an iterator over the elements in this list in proper sequence.
|
int |
lastIndexOf(E e)
Returns the index of the last occurrence of the specified element
in this list, or -1 if this list does not contain the element.
|
E |
remove(int index)
Removes the element at the specified position in this list.
|
boolean |
remove(E e)
Removes the first occurrence of the specified element from this list,
if it is present. Returns
true if the element was present. |
protected void |
removeRange(int fromIndex,
int toIndex)
Removes from this list all of the elements whose index is between
fromIndex , inclusive, and toIndex , exclusive. |
E |
set(int index,
E element)
Replaces the element at the specified position in this list with
the specified element.
|
int |
size()
Returns the number of elements in this list.
|
<T> T[] |
toArray(T[] a)
Returns an array containing all of the elements in this list in proper
sequence (from first to last element); the runtime type of the returned
array is that of the specified array.
|
void |
trimToSize()
Trims the capacity of this ArrayList instance to be the
list's current size.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(E e)
Adds the specified element to this set if it is not already present.
|
void |
clear()
Removes all of the elements from this set.
|
boolean |
contains(E e)
Returns true if this set contains the specified element.
|
boolean |
isEmpty()
Returns true if this set contains no elements.
|
Iterator<E> |
iterator()
Returns an iterator over the elements in this set.
|
boolean |
remove(E e)
Removes the specified element from this set if it is present.
|
int |
size()
Returns the number of elements in this set (its cardinality).
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Removes all of the mappings from this map.
|
boolean |
containsKey(K key)
Returns true if this map contains a mapping for the
specified key.
|
boolean |
containsValue(V value)
Returns true if this map maps one or more keys to the
specified value.
|
V |
get(K key)
Returns the value to which the specified key is mapped,
or
null if this map contains no mapping for the key. |
boolean |
isEmpty()
Returns true if this map contains no key-value mappings.
|
Set<K> |
keySet()
Returns a
Set view of the keys contained in this map. |
V |
put(K key,
V value)
Associates the specified value with the specified key in this map.
|
V |
remove(K key)
Removes the mapping for the specified key from this map if present.
|
int |
size()
Returns the number of key-value mappings in this map.
|