Interface ConcurrentDirectDeque<E>
- Type Parameters:
E- the element type
- All Superinterfaces:
Collection<E>, Deque<E>, Iterable<E>, Queue<E>, SequencedCollection<E>
A concurrent deque that allows direct item removal without traversal.
- Author:
- Jason T. Greene, Paul Ferraro
-
Method Summary
Modifier and TypeMethodDescriptiondefault booleandefault Eelement()static <K> ConcurrentDirectDeque<K> Creates a new concurrent direct deque.default booleanEquivalent toDeque.offerFirst(Object), but returns a token used for fast removal.Equivalent toDeque.offerLast(Object), but returns a token used for fast removal.default Epeek()default Epoll()default Epop()default voiddefault Eremove()default booleanvoidremoveToken(Object token) Removes the element associated with the given token.Methods inherited from interface Collection
clear, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArrayMethods inherited from interface Deque
addAll, addFirst, addLast, contains, descendingIterator, getFirst, getLast, iterator, offerFirst, offerLast, peekFirst, peekLast, pollFirst, pollLast, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, reversed, size
-
Method Details
-
newInstance
Creates a new concurrent direct deque.- Type Parameters:
K- the element type- Returns:
- a new concurrent direct deque.
-
offerFirstAndReturnToken
Equivalent toDeque.offerFirst(Object), but returns a token used for fast removal.- Parameters:
e- the element to offer- Returns:
- a token suitable for use by
remove(Object)
-
offerLastAndReturnToken
Equivalent toDeque.offerLast(Object), but returns a token used for fast removal.- Parameters:
e- the element to offer- Returns:
- a token suitable for use by
remove(Object)
-
removeToken
Removes the element associated with the given token.- Parameters:
token- the token returned viaofferFirstAndReturnToken(Object)orofferLastAndReturnToken(Object).
-
add
-
remove
-
peek
-
pop
-
push
-
element
-
offer
-
poll
-
remove
-