DthingApi
|
Public Member Functions | |
void | add (int location, E object) |
boolean | add (E object) |
boolean | addAll (int location, Collection<? extends E > collection) |
boolean | addAll (Collection<? extends E > collection) |
void | clear () |
boolean | contains (Object object) |
boolean | containsAll (Collection<?> collection) |
boolean | equals (Object object) |
E | get (int location) |
int | hashCode () |
int | indexOf (Object object) |
boolean | isEmpty () |
Iterator< E > | iterator () |
int | lastIndexOf (Object object) |
ListIterator< E > | listIterator () |
ListIterator< E > | listIterator (int location) |
E | remove (int location) |
boolean | remove (Object object) |
boolean | removeAll (Collection<?> collection) |
boolean | retainAll (Collection<?> collection) |
E | set (int location, E object) |
int | size () |
List< E > | subList (int start, int end) |
Object [] | toArray () |
A
is a collection which maintains an ordering for its elements. Every element in the
has an index. Each element can thus be accessed by its index, with the first index being zero. Normally,
s allow duplicate elements, as compared to Sets, where elements have to be unique.
void java.util.List< E >.add | ( | int | location, |
E | object | ||
) |
Inserts the specified object into this
at the specified location. The object is inserted before the current element at the specified location. If the location is equal to the size of this
, the object is added at the end. If the location is smaller than the size of this
, then all elements beyond the specified location are moved by one position towards the end of the
.
location | the index at which to insert. |
object | the object to add. |
UnsupportedOperationException | if adding to this List |
ClassCastException | if the class of the object is inappropriate for this List |
IllegalArgumentException | if the object cannot be added to this List |
IndexOutOfBoundsException | if location < 0 || location > size() |
Implemented in java.util.AbstractList< E >, java.util.ArrayList< E >, and java.util.Vector< E >.
boolean java.util.List< E >.add | ( | E | object | ) |
Adds the specified object at the end of this
.
object | the object to add. |
UnsupportedOperationException | if adding to this List |
ClassCastException | if the class of the object is inappropriate for this List |
IllegalArgumentException | if the object cannot be added to this List |
Implements java.util.Collection< E >.
Implemented in java.util.AbstractList< E >, java.util.Vector< E >, and java.util.ArrayList< E >.
boolean java.util.List< E >.addAll | ( | int | location, |
Collection<? extends E > | collection | ||
) |
Inserts the objects in the specified collection at the specified location in this
. The objects are added in the order they are returned from the collection's iterator.
location | the index at which to insert. |
collection | the collection of objects to be inserted. |
UnsupportedOperationException | if adding to this List |
ClassCastException | if the class of an object is inappropriate for this List |
IllegalArgumentException | if an object cannot be added to this List |
IndexOutOfBoundsException | if location < 0 || > size() |
Implemented in java.util.AbstractList< E >, java.util.ArrayList< E >, and java.util.Vector< E >.
boolean java.util.List< E >.addAll | ( | Collection<? extends E > | collection | ) |
Adds the objects in the specified collection to the end of this
. The objects are added in the order in which they are returned from the collection's iterator.
collection | the collection of objects. |
UnsupportedOperationException | if adding to this List |
ClassCastException | if the class of an object is inappropriate for this List |
IllegalArgumentException | if an object cannot be added to this List |
Implements java.util.Collection< E >.
Implemented in java.util.Vector< E >, and java.util.ArrayList< E >.
void java.util.List< E >.clear | ( | ) |
Removes all elements from this
, leaving it empty.
UnsupportedOperationException | if removing from this List |
Implements java.util.Collection< E >.
Implemented in java.util.AbstractList< E >, java.util.ArrayList< E >, and java.util.Vector< E >.
boolean java.util.List< E >.contains | ( | Object | object | ) |
Tests whether this
contains the specified object.
object | the object to search for. |
Implements java.util.Collection< E >.
Implemented in java.util.ArrayList< E >, and java.util.Vector< E >.
boolean java.util.List< E >.containsAll | ( | Collection<?> | collection | ) |
Tests whether this
contains all objects contained in the specified collection.
collection | the collection of objects |
Implements java.util.Collection< E >.
Implemented in java.util.Vector< E >.
boolean java.util.List< E >.equals | ( | Object | object | ) |
Compares the given object with the
, and returns true if they represent the same object using a class specific comparison. For
s, this means that they contain the same elements in exactly the same order.
object | the object to compare with this object. |
Implements java.util.Collection< E >.
Implemented in java.util.ArrayList< E >, java.util.AbstractList< E >, and java.util.Vector< E >.
E java.util.List< E >.get | ( | int | location | ) |
Returns the element at the specified location in this
.
location | the index of the element to return. |
IndexOutOfBoundsException | if location < 0 || >= size() |
Implemented in java.util.AbstractList< E >, java.util.Vector< E >, and java.util.ArrayList< E >.
int java.util.List< E >.hashCode | ( | ) |
Returns the hash code for this
. It is calculated by taking each element' hashcode and its position in the
into account.
Implements java.util.Collection< E >.
Implemented in java.util.ArrayList< E >, java.util.AbstractList< E >, and java.util.Vector< E >.
int java.util.List< E >.indexOf | ( | Object | object | ) |
Searches this
for the specified object and returns the index of the first occurrence.
object | the object to search for. |
Implemented in java.util.AbstractList< E >, java.util.Vector< E >, and java.util.ArrayList< E >.
boolean java.util.List< E >.isEmpty | ( | ) |
Returns whether this
contains no elements.
Implements java.util.Collection< E >.
Implemented in java.util.Vector< E >, and java.util.ArrayList< E >.
Iterator<E> java.util.List< E >.iterator | ( | ) |
Returns an iterator on the elements of this
. The elements are iterated in the same order as they occur in the
.
Implements java.util.Collection< E >.
Implemented in java.util.AbstractList< E >, and java.util.ArrayList< E >.
int java.util.List< E >.lastIndexOf | ( | Object | object | ) |
Searches this
for the specified object and returns the index of the last occurrence.
object | the object to search for. |
Implemented in java.util.Vector< E >, java.util.AbstractList< E >, and java.util.ArrayList< E >.
ListIterator<E> java.util.List< E >.listIterator | ( | ) |
Returns a
iterator on the elements of this
. The elements are iterated in the same order that they occur in the
.
Implemented in java.util.AbstractList< E >.
ListIterator<E> java.util.List< E >.listIterator | ( | int | location | ) |
Returns a list iterator on the elements of this
. The elements are iterated in the same order as they occur in the
. The iteration starts at the specified location.
location | the index at which to start the iteration. |
IndexOutOfBoundsException | if location < 0 || location > size() |
Implemented in java.util.AbstractList< E >.
E java.util.List< E >.remove | ( | int | location | ) |
Removes the object at the specified location from this
.
location | the index of the object to remove. |
UnsupportedOperationException | if removing from this List |
IndexOutOfBoundsException | if location < 0 || >= size() |
Implemented in java.util.Vector< E >, java.util.AbstractList< E >, and java.util.ArrayList< E >.
boolean java.util.List< E >.remove | ( | Object | object | ) |
Removes the first occurrence of the specified object from this
.
object | the object to remove. |
UnsupportedOperationException | if removing from this List |
Implements java.util.Collection< E >.
Implemented in java.util.Vector< E >, and java.util.ArrayList< E >.
boolean java.util.List< E >.removeAll | ( | Collection<?> | collection | ) |
Removes all occurrences in this
of each object in the specified collection.
collection | the collection of objects to remove. |
UnsupportedOperationException | if removing from this List |
Implements java.util.Collection< E >.
Implemented in java.util.Vector< E >.
boolean java.util.List< E >.retainAll | ( | Collection<?> | collection | ) |
Removes all objects from this
that are not contained in the specified collection.
collection | the collection of objects to retain. |
UnsupportedOperationException | if removing from this List |
Implements java.util.Collection< E >.
Implemented in java.util.Vector< E >.
E java.util.List< E >.set | ( | int | location, |
E | object | ||
) |
Replaces the element at the specified location in this
with the specified object. This operation does not change the size of the
.
location | the index at which to put the specified object. |
object | the object to insert. |
UnsupportedOperationException | if replacing elements in this List |
ClassCastException | if the class of an object is inappropriate for this List |
IllegalArgumentException | if an object cannot be added to this List |
IndexOutOfBoundsException | if location < 0 || >= size() |
Implemented in java.util.Vector< E >, java.util.AbstractList< E >, and java.util.ArrayList< E >.
int java.util.List< E >.size | ( | ) |
Returns the number of elements in this
.
Implements java.util.Collection< E >.
Implemented in java.util.Vector< E >, and java.util.ArrayList< E >.
List<E> java.util.List< E >.subList | ( | int | start, |
int | end | ||
) |
Returns a
of the specified portion of this
from the given start index to the end index minus one. The returned
is backed by this
so changes to it are reflected by the other.
start | the index at which to start the sublist. |
end | the index one past the end of the sublist. |
IndexOutOfBoundsException | if start < 0, start > end end > size() |
Implemented in java.util.Vector< E >, and java.util.AbstractList< E >.
Object [] java.util.List< E >.toArray | ( | ) |
Returns an array containing all elements contained in this
.
Implements java.util.Collection< E >.
Implemented in java.util.Vector< E >, and java.util.ArrayList< E >.