API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.util. LinkedList View Source
Author(s)
Josh Bloch
Since
1.2
Version
1.67, 04/21/06
Serial
Hierarchy
 Object
      AbstractCollection
          AbstractList
              AbstractSequentialList
                  LinkedList
Implements
 List
 Deque
 Cloneable
 Serializable
Subclasses
Description
public class LinkedList
  Linked list implementation of the List interface.
See also:    List ArrayList Vector
Constructors
public LinkedList ()
Constructs an empty list.
public LinkedList (Collection<Object> c)
  Constructs a list containing the elements of the specified collection, in the order they are returned by the collection's iterator.
Methods
Hide/Show inherited methods
public boolean add ( E e) [Overrides AbstractList] [Specified in List]
  Appends the specified element to the end of this list.
public void add (int index, E element) [Overrides AbstractSequentialList] [Specified in List]
  Inserts the specified element at the specified position in this list.
public boolean addAll (Collection<Object> c) [Overrides AbstractCollection] [Specified in List]
  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.
public boolean addAll (int index, Collection<Object> c) [Overrides AbstractSequentialList] [Specified in List]
  Inserts all of the elements in the specified collection into this list, starting at the specified position.
public void addFirst ( E e) [Specified in Deque]
  Inserts the specified element at the beginning of this list.
public void addLast ( E e) [Specified in Deque]
  Appends the specified element to the end of this list.
public void clear () [Overrides AbstractList] [Specified in List]
Removes all of the elements from this list.
public Object clone ()
  Returns a shallow copy of this LinkedList.
public boolean contains (Object o) [Overrides AbstractCollection] [Specified in List]
  Returns true if this list contains the specified element.
public boolean containsAll (Collection<Object> c) [Inherited From AbstractCollection]
  Returns true if this collection contains all of the elements in the specified collection.
public Iterator< E> descendingIterator () [Specified in Deque]
 
public E element () [Specified in Deque]
  Retrieves, but does not remove, the head (first element) of this list.
public boolean equals (Object o) [Inherited From AbstractList]
  Compares the specified object with this list for equality.
public E get (int index) [Overrides AbstractSequentialList] [Specified in List]
  Returns the element at the specified position in this list.
public E getFirst () [Specified in Deque]
  Returns the first element in this list.
public E getLast () [Specified in Deque]
  Returns the last element in this list.
public int hashCode () [Inherited From AbstractList]
  Returns the hash code value for this list.
public int indexOf (Object o) [Overrides AbstractList] [Specified in List]
  Returns the index of the first occurrence of the specified element in this list, or -1 if this list does not contain the element.
public boolean isEmpty () [Inherited From AbstractCollection]
  Returns true if this collection contains no elements.
public Iterator< E> iterator () [Inherited From AbstractSequentialList] [Specified in AbstractCollection]
  Returns an iterator over the elements in this list (in proper sequence).
public int lastIndexOf (Object o) [Overrides AbstractList] [Specified in List]
  Returns the index of the last occurrence of the specified element in this list, or -1 if this list does not contain the element.
public ListIterator< E> listIterator () [Inherited From AbstractList]
  Returns a list iterator over the elements in this list (in proper sequence).
public ListIterator< E> listIterator (int index) [Overrides AbstractList] [Specified in List]
  Returns a list-iterator of the elements in this list (in proper sequence), starting at the specified position in the list.
public boolean offer ( E e) [Specified in Deque]
  Adds the specified element as the tail (last element) of this list.
public boolean offerFirst ( E e) [Specified in Deque]
  Inserts the specified element at the front of this list.
public boolean offerLast ( E e) [Specified in Deque]
  Inserts the specified element at the end of this list.
public E peek () [Specified in Deque]
  Retrieves, but does not remove, the head (first element) of this list.
public E peekFirst () [Specified in Deque]
  Retrieves, but does not remove, the first element of this list, or returns null if this list is empty.
public E peekLast () [Specified in Deque]
  Retrieves, but does not remove, the last element of this list, or returns null if this list is empty.
public E poll () [Specified in Deque]
  Retrieves and removes the head (first element) of this list
public E pollFirst () [Specified in Deque]
  Retrieves and removes the first element of this list, or returns null if this list is empty.
public E pollLast () [Specified in Deque]
  Retrieves and removes the last element of this list, or returns null if this list is empty.
public E pop () [Specified in Deque]
  Pops an element from the stack represented by this list.
public void push ( E e) [Specified in Deque]
  Pushes an element onto the stack represented by this list.
public E remove () [Specified in Deque]
  Retrieves and removes the head (first element) of this list.
public E remove (int index) [Overrides AbstractSequentialList] [Specified in List]
  Removes the element at the specified position in this list.
public boolean remove (Object o) [Overrides AbstractCollection] [Specified in List]
  Removes the first occurrence of the specified element from this list, if it is present.
public boolean removeAll (Collection<Object> c) [Inherited From AbstractCollection]
  Removes all of this collection's elements that are also contained in the specified collection (optional operation).
public E removeFirst () [Specified in Deque]
  Removes and returns the first element from this list.
public boolean removeFirstOccurrence (Object o) [Specified in Deque]
  Removes the first occurrence of the specified element in this list (when traversing the list from head to tail).
public E removeLast () [Specified in Deque]
  Removes and returns the last element from this list.
public boolean removeLastOccurrence (Object o) [Specified in Deque]
  Removes the last occurrence of the specified element in this list (when traversing the list from head to tail).
protected void removeRange (int fromIndex, int toIndex) [Inherited From AbstractList]
  Removes from this list all of the elements whose index is between fromIndex, inclusive, and toIndex, exclusive.
public boolean retainAll (Collection<Object> c) [Inherited From AbstractCollection]
  Retains only the elements in this collection that are contained in the specified collection (optional operation).
public E set (int index, E element) [Overrides AbstractSequentialList] [Specified in List]
  Replaces the element at the specified position in this list with the specified element.
public int size () [Specified in List]
  Returns the number of elements in this list.
public List< E> subList (int fromIndex, int toIndex) [Inherited From AbstractList]
  Returns a view of the portion of this list between the specified fromIndex, inclusive, and toIndex, exclusive.
public Object toArray () [Overrides AbstractCollection] [Specified in List]
  Returns an array containing all of the elements in this list in proper sequence (from first to last element).
public T toArray ( T a) [Overrides AbstractCollection] [Specified in List]
  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.
public String toString () [Inherited From AbstractCollection]
  Returns a string representation of this collection.
Fields
Hide/Show inherited fields
protectedtransient int modCount [Inherited From AbstractList]
  The number of times this list has been structurally modified.
Nested Classes
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar