public class LIFOLinkedBlockingDeque<T> extends LinkedBlockingDeque<T>
LinkedBlockingDeque
using LIFO algorithm构造器和说明 |
---|
LIFOLinkedBlockingDeque() |
限定符和类型 | 方法和说明 |
---|---|
boolean |
offer(T e)
Inserts the specified element at the front of this deque if it is possible to do so immediately without violating
capacity restrictions, returning true upon success and false if no space is currently
available.
|
T |
remove()
Retrieves and removes the first element of this deque.
|
add, addFirst, addLast, clear, contains, descendingIterator, drainTo, drainTo, element, getFirst, getLast, iterator, offer, offerFirst, offerFirst, offerLast, offerLast, peek, peekFirst, peekLast, poll, poll, pollFirst, pollFirst, pollLast, pollLast, pop, push, put, putFirst, putLast, remainingCapacity, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, size, take, takeFirst, takeLast, toArray, toArray, toString
addAll
containsAll, isEmpty, removeAll, retainAll
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addAll, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, spliterator, stream
public boolean offer(T e)
addFirst
method, which can fail to insert an element only by throwing an exception.offer
在接口中 BlockingDeque<T>
offer
在接口中 Deque<T>
offer
在接口中 BlockingQueue<T>
offer
在接口中 Queue<T>
offer
在类中 LinkedBlockingDeque<T>
e
- the element to addClassCastException
- if the class of the specified element
prevents it from being added to this dequeNullPointerException
- if the specified element is nullIllegalArgumentException
- if some property of the specified
element prevents it from being added to this dequepublic T remove()
pollFirst
only
in that it throws an exception if this deque is empty.remove
在接口中 BlockingDeque<T>
remove
在接口中 Deque<T>
remove
在接口中 Queue<T>
remove
在类中 LinkedBlockingDeque<T>
NoSuchElementException
- if this deque is empty