Class AbstractLinkedDeque<E>
java.lang.Object
java.util.AbstractCollection<E>
com.github.benmanes.caffeine.cache.AbstractLinkedDeque<E>
- Type Parameters:
E- the type of elements held in this collection
- All Implemented Interfaces:
LinkedDeque<E>, Iterable<E>, Collection<E>, Deque<E>, Queue<E>, SequencedCollection<E>
- Direct Known Subclasses:
AccessOrderDeque, WriteOrderDeque
This class provides a skeletal implementation of the
LinkedDeque interface to minimize
the effort required to implement this interface.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) classNested classes/interfaces inherited from interface LinkedDeque
LinkedDeque.PeekingIterator<E> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanvoidvoid(package private) voidvoidclear()abstract booleanelement()getFirst()getLast()booleanisEmpty()booleanReturns if the element is at the front of the deque.booleanReturns if the element is at the back of the deque.iterator()(package private) voidLinks the element to the front of the deque so that it becomes the first element.(package private) voidLinks the element to the back of the deque so that it becomes the last element.voidmoveToBack(E e) Moves the element to the back of the deque so that it becomes the last element.voidmoveToFront(E e) Moves the element to the front of the deque so that it becomes the first element.booleanbooleanofferFirst(E e) boolean@Nullable Epeek()@Nullable E@Nullable EpeekLast()@Nullable Epoll()@Nullable E@Nullable EpollLast()pop()voidremove()booleanremoveAll(Collection<?> c) booleanbooleanintsize()(package private) voidUnlinks the non-null element.(package private) EUnlinks the non-null first element.(package private) EUnlinks the non-null last element.Methods inherited from class AbstractCollection
addAll, containsAll, remove, retainAll, toArray, toArray, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Collection
containsAll, equals, hashCode, parallelStream, removeIf, retainAll, spliterator, stream, toArray, toArray, toArrayMethods inherited from interface LinkedDeque
getNext, getPrevious, setNext, setPrevious
-
Field Details
-
Constructor Details
-
AbstractLinkedDeque
AbstractLinkedDeque()
-
-
Method Details
-
linkFirst
Links the element to the front of the deque so that it becomes the first element.- Parameters:
e- the unlinked element
-
linkLast
Links the element to the back of the deque so that it becomes the last element.- Parameters:
e- the unlinked element
-
unlinkFirst
E unlinkFirst()Unlinks the non-null first element. -
unlinkLast
E unlinkLast()Unlinks the non-null last element. -
unlink
Unlinks the non-null element. -
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<E>- Overrides:
isEmptyin classAbstractCollection<E>
-
checkNotEmpty
void checkNotEmpty() -
size
public int size()Beware that, unlike in most collections, this method is NOT a constant-time operation.
- Specified by:
sizein interfaceCollection<E>- Specified by:
sizein interfaceDeque<E>- Specified by:
sizein classAbstractCollection<E>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<E>- Overrides:
clearin classAbstractCollection<E>
-
contains
- Specified by:
containsin interfaceCollection<E>- Specified by:
containsin interfaceDeque<E>- Overrides:
containsin classAbstractCollection<E>
-
isFirst
Description copied from interface:LinkedDequeReturns if the element is at the front of the deque.- Specified by:
isFirstin interfaceLinkedDeque<E>- Parameters:
e- the linked element
-
isLast
Description copied from interface:LinkedDequeReturns if the element is at the back of the deque.- Specified by:
isLastin interfaceLinkedDeque<E>- Parameters:
e- the linked element
-
moveToFront
Description copied from interface:LinkedDequeMoves the element to the front of the deque so that it becomes the first element.- Specified by:
moveToFrontin interfaceLinkedDeque<E>- Parameters:
e- the linked element
-
moveToBack
Description copied from interface:LinkedDequeMoves the element to the back of the deque so that it becomes the last element.- Specified by:
moveToBackin interfaceLinkedDeque<E>- Parameters:
e- the linked element
-
peek
-
peekFirst
-
peekLast
-
getFirst
-
getLast
-
element
-
offer
-
offerFirst
- Specified by:
offerFirstin interfaceDeque<E>
-
offerLast
-
add
-
addFirst
-
addLast
-
poll
-
pollFirst
-
pollLast
-
remove
-
removeFirst
- Specified by:
removeFirstin interfaceDeque<E>- Specified by:
removeFirstin interfaceSequencedCollection<E>
-
removeFirstOccurrence
- Specified by:
removeFirstOccurrencein interfaceDeque<E>
-
removeLast
- Specified by:
removeLastin interfaceDeque<E>- Specified by:
removeLastin interfaceSequencedCollection<E>
-
removeLastOccurrence
- Specified by:
removeLastOccurrencein interfaceDeque<E>
-
removeAll
- Specified by:
removeAllin interfaceCollection<E>- Overrides:
removeAllin classAbstractCollection<E>
-
push
-
pop
-
iterator
- Specified by:
iteratorin interfaceCollection<E>- Specified by:
iteratorin interfaceDeque<E>- Specified by:
iteratorin interfaceIterable<E>- Specified by:
iteratorin interfaceLinkedDeque<E>- Specified by:
iteratorin classAbstractCollection<E>
-
descendingIterator
- Specified by:
descendingIteratorin interfaceDeque<E>- Specified by:
descendingIteratorin interfaceLinkedDeque<E>
-