????3.???????????
????a:??????

 

public LinkedList() {
}
public LinkedList(Collection<? extends E> c) {
this();
addAll(c);
}
public boolean addAll(Collection<? extends E> c) {
return addAll(size?? c);
}
public boolean addAll(int index?? Collection<? extends E> c) {
checkPositionIndex(index);
Object[] a = c.toArray();
int numNew = a.length;
if (numNew == 0)
return false;
Node<E> pred?? succ;
if (index == size) {
succ = null;
pred = last;
} else {
succ = node(index);
pred = succ.prev;
}
for (Object o : a) {
@SuppressWarnings("unchecked") E e = (E) o;
Node<E> newNode = new Node<>(pred?? e?? null);
if (pred == null)
first = newNode;
else
pred.next = newNode;
pred = newNode;
}
if (succ == null) {
last = pred;
} else {
pred.next = succ;
succ.prev = pred;
}
size += numNew;
modCount++;
return true;
}<br>

??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????addAll()?????????????????????????????????????addAll()???????????ж?????????????????????????????????????Object????????饗????????飩??
????Node<E> pred?? succ;
????if (index == size) {
????succ = null;
????pred = last;
????} else {
????succ = node(index);
????pred = succ.prev;
????}
????????ж??????????????????????С???????????????????????β??????????β??????pred;???????????????????????????в???????λ?á????????????????????????У?