E - the type of elements held in this collectionpublic class LinkedDeque<E extends Linked<E>> extends AbstractCollection<E> implements Deque<E>
Deque interface where the link
pointers are tightly integrated with the element. Linked deques have no
capacity restrictions; they grow as necessary to support usage. They are not
thread-safe; in the absence of external synchronization, they do not support
concurrent access by multiple threads. Null elements are prohibited.
Most LinkedDeque operations run in constant time by assuming that
the Linked parameter is associated with the deque instance. Any usage
that violates this assumption will result in non-deterministic behavior.
The iterators returned by this class are not fail-fast: If the deque is modified at any time after the iterator is created, the iterator will be in an unknown state. Thus, in the face of concurrent modification, the iterator risks arbitrary, non-deterministic behavior at an undetermined time in the future.
| 构造器和说明 |
|---|
LinkedDeque() |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
add(E e) |
void |
addFirst(E e) |
void |
addLast(E e) |
void |
clear() |
boolean |
contains(Object o) |
Iterator<E> |
descendingIterator() |
E |
element() |
E |
getFirst() |
E |
getLast() |
boolean |
isEmpty() |
Iterator<E> |
iterator() |
void |
moveToBack(E e)
Moves the element to the back of the deque so that it becomes the last
element.
|
void |
moveToFront(E e)
Moves the element to the front of the deque so that it becomes the first
element.
|
boolean |
offer(E e) |
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() |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
E |
removeFirst() |
boolean |
removeFirstOccurrence(Object o) |
E |
removeLast() |
boolean |
removeLastOccurrence(Object o) |
int |
size()
Beware that, unlike in most collections, this method is NOT a
constant-time operation.
|
addAll, containsAll, retainAll, toArray, toArray, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddAll, containsAll, equals, hashCode, parallelStream, removeIf, retainAll, spliterator, stream, toArray, toArraypublic boolean isEmpty()
isEmpty 在接口中 Collection<E extends Linked<E>>isEmpty 在类中 AbstractCollection<E extends Linked<E>>public int size()
Beware that, unlike in most collections, this method is NOT a constant-time operation.
public void clear()
clear 在接口中 Collection<E extends Linked<E>>clear 在类中 AbstractCollection<E extends Linked<E>>public boolean contains(Object o)
public void moveToFront(E e)
e - the linked elementpublic void moveToBack(E e)
e - the linked elementpublic E peek()
public E element()
public boolean offer(E e)
public boolean add(E e)
public E poll()
public E remove()
public boolean remove(Object o)
public boolean removeFirstOccurrence(Object o)
removeFirstOccurrence 在接口中 Deque<E extends Linked<E>>public boolean removeLastOccurrence(Object o)
removeLastOccurrence 在接口中 Deque<E extends Linked<E>>public boolean removeAll(Collection<?> c)
removeAll 在接口中 Collection<E extends Linked<E>>removeAll 在类中 AbstractCollection<E extends Linked<E>>Copyright © 2024. All rights reserved.