LinkedList (Java Platform SE 7 ) (original) (raw)

Modifier and Type

Method and Description

boolean

**[add](../../java/util/LinkedList.html#add%28E%29)**([E](../../java/util/LinkedList.html "type parameter in LinkedList") e)

Appends the specified element to the end of this list.

void

**[add](../../java/util/LinkedList.html#add%28int,%20E%29)**(int index,[E](../../java/util/LinkedList.html "type parameter in LinkedList") element)

Inserts the specified element at the specified position in this list.

boolean

**[addAll](../../java/util/LinkedList.html#addAll%28java.util.Collection%29)**([Collection](../../java/util/Collection.html "interface in java.util")<? extends [E](../../java/util/LinkedList.html "type parameter in LinkedList")> 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.

boolean

**[addAll](../../java/util/LinkedList.html#addAll%28int,%20java.util.Collection%29)**(int index,[Collection](../../java/util/Collection.html "interface in java.util")<? extends [E](../../java/util/LinkedList.html "type parameter in LinkedList")> c)

Inserts all of the elements in the specified collection into this list, starting at the specified position.

void

**[addFirst](../../java/util/LinkedList.html#addFirst%28E%29)**([E](../../java/util/LinkedList.html "type parameter in LinkedList") e)

Inserts the specified element at the beginning of this list.

void

**[addLast](../../java/util/LinkedList.html#addLast%28E%29)**([E](../../java/util/LinkedList.html "type parameter in LinkedList") e)

Appends the specified element to the end of this list.

void

**[clear](../../java/util/LinkedList.html#clear%28%29)**()

Removes all of the elements from this list.

[Object](../../java/lang/Object.html "class in java.lang")

**[clone](../../java/util/LinkedList.html#clone%28%29)**()

Returns a shallow copy of this LinkedList.

boolean

**[contains](../../java/util/LinkedList.html#contains%28java.lang.Object%29)**([Object](../../java/lang/Object.html "class in java.lang") o)

Returns true if this list contains the specified element.

[Iterator](../../java/util/Iterator.html "interface in java.util")<[E](../../java/util/LinkedList.html "type parameter in LinkedList")>

**[descendingIterator](../../java/util/LinkedList.html#descendingIterator%28%29)**()

Returns an iterator over the elements in this deque in reverse sequential order.

[E](../../java/util/LinkedList.html "type parameter in LinkedList")

**[element](../../java/util/LinkedList.html#element%28%29)**()

Retrieves, but does not remove, the head (first element) of this list.

[E](../../java/util/LinkedList.html "type parameter in LinkedList")

**[get](../../java/util/LinkedList.html#get%28int%29)**(int index)

Returns the element at the specified position in this list.

[E](../../java/util/LinkedList.html "type parameter in LinkedList")

**[getFirst](../../java/util/LinkedList.html#getFirst%28%29)**()

Returns the first element in this list.

[E](../../java/util/LinkedList.html "type parameter in LinkedList")

**[getLast](../../java/util/LinkedList.html#getLast%28%29)**()

Returns the last element in this list.

int

**[indexOf](../../java/util/LinkedList.html#indexOf%28java.lang.Object%29)**([Object](../../java/lang/Object.html "class in java.lang") 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.

int

**[lastIndexOf](../../java/util/LinkedList.html#lastIndexOf%28java.lang.Object%29)**([Object](../../java/lang/Object.html "class in java.lang") o)

Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element.

[ListIterator](../../java/util/ListIterator.html "interface in java.util")<[E](../../java/util/LinkedList.html "type parameter in LinkedList")>

**[listIterator](../../java/util/LinkedList.html#listIterator%28int%29)**(int index)

Returns a list-iterator of the elements in this list (in proper sequence), starting at the specified position in the list.

boolean

**[offer](../../java/util/LinkedList.html#offer%28E%29)**([E](../../java/util/LinkedList.html "type parameter in LinkedList") e)

Adds the specified element as the tail (last element) of this list.

boolean

**[offerFirst](../../java/util/LinkedList.html#offerFirst%28E%29)**([E](../../java/util/LinkedList.html "type parameter in LinkedList") e)

Inserts the specified element at the front of this list.

boolean

**[offerLast](../../java/util/LinkedList.html#offerLast%28E%29)**([E](../../java/util/LinkedList.html "type parameter in LinkedList") e)

Inserts the specified element at the end of this list.

[E](../../java/util/LinkedList.html "type parameter in LinkedList")

**[peek](../../java/util/LinkedList.html#peek%28%29)**()

Retrieves, but does not remove, the head (first element) of this list.

[E](../../java/util/LinkedList.html "type parameter in LinkedList")

**[peekFirst](../../java/util/LinkedList.html#peekFirst%28%29)**()

Retrieves, but does not remove, the first element of this list, or returns null if this list is empty.

[E](../../java/util/LinkedList.html "type parameter in LinkedList")

**[peekLast](../../java/util/LinkedList.html#peekLast%28%29)**()

Retrieves, but does not remove, the last element of this list, or returns null if this list is empty.

[E](../../java/util/LinkedList.html "type parameter in LinkedList")

**[poll](../../java/util/LinkedList.html#poll%28%29)**()

Retrieves and removes the head (first element) of this list.

[E](../../java/util/LinkedList.html "type parameter in LinkedList")

**[pollFirst](../../java/util/LinkedList.html#pollFirst%28%29)**()

Retrieves and removes the first element of this list, or returns null if this list is empty.

[E](../../java/util/LinkedList.html "type parameter in LinkedList")

**[pollLast](../../java/util/LinkedList.html#pollLast%28%29)**()

Retrieves and removes the last element of this list, or returns null if this list is empty.

[E](../../java/util/LinkedList.html "type parameter in LinkedList")

**[pop](../../java/util/LinkedList.html#pop%28%29)**()

Pops an element from the stack represented by this list.

void

**[push](../../java/util/LinkedList.html#push%28E%29)**([E](../../java/util/LinkedList.html "type parameter in LinkedList") e)

Pushes an element onto the stack represented by this list.

[E](../../java/util/LinkedList.html "type parameter in LinkedList")

**[remove](../../java/util/LinkedList.html#remove%28%29)**()

Retrieves and removes the head (first element) of this list.

[E](../../java/util/LinkedList.html "type parameter in LinkedList")

**[remove](../../java/util/LinkedList.html#remove%28int%29)**(int index)

Removes the element at the specified position in this list.

boolean

**[remove](../../java/util/LinkedList.html#remove%28java.lang.Object%29)**([Object](../../java/lang/Object.html "class in java.lang") o)

Removes the first occurrence of the specified element from this list, if it is present.

[E](../../java/util/LinkedList.html "type parameter in LinkedList")

**[removeFirst](../../java/util/LinkedList.html#removeFirst%28%29)**()

Removes and returns the first element from this list.

boolean

**[removeFirstOccurrence](../../java/util/LinkedList.html#removeFirstOccurrence%28java.lang.Object%29)**([Object](../../java/lang/Object.html "class in java.lang") o)

Removes the first occurrence of the specified element in this list (when traversing the list from head to tail).

[E](../../java/util/LinkedList.html "type parameter in LinkedList")

**[removeLast](../../java/util/LinkedList.html#removeLast%28%29)**()

Removes and returns the last element from this list.

boolean

**[removeLastOccurrence](../../java/util/LinkedList.html#removeLastOccurrence%28java.lang.Object%29)**([Object](../../java/lang/Object.html "class in java.lang") o)

Removes the last occurrence of the specified element in this list (when traversing the list from head to tail).

[E](../../java/util/LinkedList.html "type parameter in LinkedList")

**[set](../../java/util/LinkedList.html#set%28int,%20E%29)**(int index,[E](../../java/util/LinkedList.html "type parameter in LinkedList") element)

Replaces the element at the specified position in this list with the specified element.

int

**[size](../../java/util/LinkedList.html#size%28%29)**()

Returns the number of elements in this list.

[Object](../../java/lang/Object.html "class in java.lang")[]

**[toArray](../../java/util/LinkedList.html#toArray%28%29)**()

Returns an array containing all of the elements in this list in proper sequence (from first to last element).

<T> T[]

**[toArray](../../java/util/LinkedList.html#toArray%28T[]%29)**(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.