All implementations of collections share the same API, enabling the user to work with collection contents: add new elements, check the collection size, remove some elements from the collection, etc. The table below lists most frequently needed functions along with their descriptions. If you need to perform some more specific operation, please refer to the complete documentation on Java collections available at http://java.sun.com/j2se/1.5.0/docs/guide/collections.
Returns the number of elements in the list.
Tests if this list has no elements. Returns true if the container has no elements, and false otherwise.
|boolean add(<ElementClass> element)||
Appends the specified element to the end of this list. Ensures that the container holds the argument. Returns false if the adding was not performed
|void add(int index, <ElementClass> element)||
Inserts the specified element at the specified position in the list. Shifts the element currently at that position (if any) and any subsequent elements to the right (adds one to their indices).
|boolean addAll(Collection c)||
Appends all of the elements in the specified Collection to the end of this list, in the order that they are returned by the specified Collection's Iterator.
Removes all the elements from the collection.
|boolean contains(<ElementClass> element)||
if this list contains the specified element.
|<ElementClass> get(int index)||
Returns the element at the specified position in this list.
|boolean remove(<ElementClass> element)||
Removes a single instance of the specified element from this list, if it is present. Returns
if the list contained the specified element.
|<ElementClass> set(int index, <ElementClass> element)||
Replaces the element at the specified position in this list with the specified element.
Returns an array containing all the elements in the container.
|Object toArray(Object a)||
Returns an array containing all the elements in the container, whose type is that of the array rather than plain
(you must cast the array to the right type).
Please note that there is no get() function for random-access element.