![]() |
|
| - 父类 |
| - java.lang.Object |
| - - java.util.AbstractCollection |
| - - java.util.AbstractList |
| - - java.util.AbstractSequentialList |
| - - java.util.LinkedList |
| - 实现的接口 |
|
| ```java |
| List, Deque, Cloneable, java.io.Serializable |
| ``` |
|
| # 属性 |
|
| - size: 记录元素个数 |
| - Node first: 双向链表头节点 |
| - Node last: 双向链表尾节点 |
|
| # 构造方法 |
|
| - LinkedList() 构造一个空列表。 |
|
| ```java |
| /** |
| * Constructs an empty list. |
| */ |
| public LinkedList() { |
| } |
| ``` |
|
| - LinkedList(Collection<? extends E> c) 构造一个包含指定集合的元素的列表,按照它们由集合的迭代器返回的顺序。 |
|
| ```java |
| /** |
| * Constructs a list containing the elements of the specified |
| * collection, in the order they are returned by the collection's |
| * iterator. |
| * |
| * @param c the collection whose elements are to be placed into this list |
| * @throws NullPointerException if the specified collection is null |
| */ |
| public LinkedList(Collection<? extends E> c) { |
| this(); |
| addAll(c); |
| } |
| ``` |
|
|
|
| # 主要方法 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| ### Methods inherited from class java.util.AbstractSequentialList |
|
| ``` |
| iterator |
| ``` |
|
|
|
| ### Methods inherited from class java.util.AbstractList |
|
| ``` |
| equals, hashCode, listIterator, removeRange, |
| subList |
| ``` |
|
|
|
| ### Methods inherited from class java.util.AbstractCollection |
|
| ``` |
| containsAll, |
| isEmpty, removeAll, |
| retainAll, |
| toString |
| ``` |
|
|
|
| ### Methods inherited from class java.lang.Object |
|
| ``` |
| finalize, getClass, notify, notifyAll, wait, wait, wait |
| ``` |
|
|
|
| ### Methods inherited from interface java.util.List |
|
| ``` |
| containsAll, |
| equals, hashCode, isEmpty, iterator, listIterator, removeAll, |
| replaceAll, |
| retainAll, |
| sort, subList |
| ``` |
|
|
|
| ### Methods inherited from interface java.util.Deque |
|
| ```java |
| iterator |
| ``` |
|
|
|
| ### Methods inherited from interface java.util.Collection |
|
| ```java |
| parallelStream, removeIf, |
| stream |
| ``` |
|
|
|
| ### Methods inherited from interface java.lang.Iterable |
|
| ```java |
| forEach |
| ``` |