Interface ConcurrentDirectDeque<E>
-
- All Superinterfaces:
Collection<E>,Deque<E>,Iterable<E>,Queue<E>
- All Known Implementing Classes:
FastConcurrentDirectDeque
public interface ConcurrentDirectDeque<E> extends Deque<E>
A concurrent deque that allows direct item removal without traversal.- Author:
- Jason T. Greene, Paul Ferraro
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default booleanadd(E e)default Eelement()static <K> ConcurrentDirectDeque<K>newInstance()default booleanoffer(E e)ObjectofferFirstAndReturnToken(E e)Equivalent toDeque.offerFirst(Object), but returns a token used for fast removal.ObjectofferLastAndReturnToken(E e)Equivalent toDeque.offerLast(Object), but returns a token used for fast removal.default Epeek()default Epoll()default Epop()default voidpush(E e)default Eremove()default booleanremove(Object o)voidremoveToken(Object token)Removes the element associated with the given token.-
Methods inherited from interface java.util.Collection
clear, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArray
-
Methods inherited from interface java.util.Deque
addAll, addFirst, addLast, contains, descendingIterator, getFirst, getLast, iterator, offerFirst, offerLast, peekFirst, peekLast, pollFirst, pollLast, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, size
-
-
-
-
Method Detail
-
newInstance
static <K> ConcurrentDirectDeque<K> newInstance()
-
offerFirstAndReturnToken
Object offerFirstAndReturnToken(E e)
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
Object offerLastAndReturnToken(E e)
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
void removeToken(Object token)
Removes the element associated with the given token.- Parameters:
token- the token returned viaofferFirstAndReturnToken(Object)orofferLastAndReturnToken(Object).
-
add
default boolean add(E e)
-
remove
default boolean remove(Object o)
-
peek
default E peek()
-
element
default E element()
-
offer
default boolean offer(E e)
-
poll
default E poll()
-
-