Java Collection--linkedlist

Source: Internet
Author: User
Tags addall

The essence of LinkedList is a doubly linked list. Implements the List interface and can queue operations on it. Implement the Deque interface to use LinkedList as a double-ended queue.
The LinkedList is non-synchronous.

The inheritance relationship of LinkedList

java.lang.Object   ?     Java.util.AbstractCollection<E>         ?     Java.util.AbstractList<E>               ?     Java.util.AbstractSequentialList<E>                     ?     Java.util.LinkedList<E>publicclass linkedlist<e>    extends abstractsequentiallist<e>    implements List<e>, Deque<e>, Cloneable, java.io.Serializable {}

LinkedList constructor function

// default constructor LinkedList () // creates a linkedlist that protects all elements in the collection.  extends e> collection)

LinkedList's API

BooleanAdd (E object)voidAddintLocation , E object)BooleanAddAll (collection<?extendsE>collection)BooleanAddAll (intLocation, collection<?extendsE>collection)voidAddFirst (E object)voidaddlast (E object)voidClear () Object clone ()Booleancontains (Object object) Iterator<E>descendingiterator () e element () e Get (intLocation ) e GetFirst () e getlast ()intindexOf (Object object)intlastIndexOf (Object object) Listiterator<E> Listiterator (intLocation )BooleanOffer (E o)BooleanOfferfirst (e e)BooleanOfferlast (e e) e peek () e Peekfirst () e peeklast () e poll () E Pollfirst () e polllast () e pop ()voidpush (e E) e remove () e Remove (intLocation )Booleanremove (Object object) E Removefirst ()Booleanremovefirstoccurrence (Object o) E removelast ()Booleanremovelastoccurrence (Object o) E set (intLocation , E object)intsize ()<T>t[] ToArray (t[] contents) object[] ToArray ()

Java Collection--linkedlist

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.