public class LinkedList<E> extends AbstractSequentialList<E> implements List<E>, Deque<E>
modCount| Constructor and Description |
|---|
LinkedList() |
LinkedList(Collection<? extends E> collection) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E object) |
void |
add(int location,
E object) |
boolean |
addAll(Collection<? extends E> collection) |
boolean |
addAll(int location,
Collection<? extends E> collection) |
void |
addFirst(E object) |
void |
addLast(E object) |
void |
clear() |
boolean |
contains(Object object) |
Iterator<E> |
descendingIterator() |
E |
element() |
E |
get(int location) |
E |
getFirst() |
E |
getLast() |
int |
indexOf(Object object) |
int |
lastIndexOf(Object object) |
ListIterator<E> |
listIterator(int location) |
boolean |
offer(E o) |
boolean |
offerFirst(E e) |
boolean |
offerLast(E e) |
E |
peek() |
E |
peekFirst() |
E |
peekLast() |
E |
poll() |
E |
pollFirst() |
E |
pollLast() |
E |
pop() |
void |
push(E e) |
E |
remove() |
E |
remove(int location) |
boolean |
remove(Object object) |
E |
removeFirst() |
boolean |
removeFirstOccurrence(Object o) |
E |
removeLast() |
boolean |
removeLastOccurrence(Object o) |
E |
set(int location,
E object) |
int |
size() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] contents) |
iteratorequals, hashCode, listIterator, removeRange, subListcontainsAll, isEmpty, removeAll, retainAll, toStringcontainsAll, equals, hashCode, isEmpty, iterator, listIterator, removeAll, replaceAll, retainAll, sort, subListremoveIfpublic LinkedList()
public LinkedList(Collection<? extends E> collection)
public void add(int location,
E object)
public boolean add(E object)
add in interface Collection<E>add in interface List<E>add in class AbstractList<E>public boolean addAll(int location,
Collection<? extends E> collection)
public boolean addAll(Collection<? extends E> collection)
addAll in interface Collection<E>addAll in interface List<E>addAll in class AbstractCollection<E>public void clear()
clear in interface Collection<E>clear in interface List<E>clear in class AbstractList<E>public boolean contains(Object object)
contains in interface Collection<E>contains in interface List<E>contains in class AbstractCollection<E>public E get(int location)
public int indexOf(Object object)
public int lastIndexOf(Object object)
lastIndexOf in interface List<E>lastIndexOf in class AbstractList<E>public ListIterator<E> listIterator(int location)
listIterator in interface List<E>listIterator in class AbstractSequentialList<E>public E remove(int location)
public boolean remove(Object object)
remove in interface Collection<E>remove in interface List<E>remove in class AbstractCollection<E>public E removeFirst()
removeFirst in interface Deque<E>public E removeLast()
removeLast in interface Deque<E>public Iterator<E> descendingIterator()
descendingIterator in interface Deque<E>public boolean offerFirst(E e)
offerFirst in interface Deque<E>public boolean removeFirstOccurrence(Object o)
removeFirstOccurrence in interface Deque<E>public boolean removeLastOccurrence(Object o)
removeLastOccurrence in interface Deque<E>public int size()
size in interface Collection<E>size in interface List<E>size in class AbstractCollection<E>public Object[] toArray()
toArray in interface Collection<E>toArray in interface List<E>toArray in class AbstractList<E>public <T> T[] toArray(T[] contents)
toArray in interface Collection<E>toArray in interface List<E>toArray in class AbstractList<E>Copyright © 2026. All rights reserved.