Payload - The payload type.public abstract class AbstractLinkedStack<Payload> extends AbstractStack<Payload>
AbstractLinkedStack is an AbstractStack that is backed by
linked elements.
An AbstractLinkedStack is by itself not thread safe and must be
synchronized externally in a multithreaded use case.
| Constructor and Description |
|---|
AbstractLinkedStack(Nullity nullity)
Creates a new
AbstractLinkedStack. |
| Modifier and Type | Method and Description |
|---|---|
protected Source<Payload> |
doClear()
Removes all payload value.
|
protected Payload |
doGetFirst()
Returns the first (i.e.
|
protected ProtectedIterator<Payload> |
doIterator()
Returns a fail-fast
ProtectedIterator that starts with the
payload value at the given first index, where 0 is the index
of most recently pushed value. |
protected Payload |
doPop()
Removes the first (i.e.
|
protected void |
doPush(Payload payload)
Pushes the given payload value as the new first value.
|
protected Payload |
doReplace(Payload replacement)
Replaces the payload value at the given index with the given replacement
payload value.
|
protected int |
doSize()
Returns the number of payload values of this
Stack. |
clear, equals, firstIndexOf, firstIndexOfMatch, get, getNullity, hashCode, iterator, onCleared, onPopped, onPushed, pop, popAll, popAllMatches, push, pushAll, pushAll, replace, sizecontains, containsAll, containsAll, containsMatch, createPredicate, firstIndexOf, getAll, getAllMatches, getFirst, getFirst, getFirstMatch, isEmpty, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetFirst, getFirst, getFirstMatchcontains, containsAll, containsAll, containsMatch, getAll, getAllMatches, isEmptyforEach, spliteratorpublic AbstractLinkedStack(Nullity nullity) throws IllegalArgumentException
AbstractLinkedStack.nullity - The Nullity to be used.IllegalArgumentException - If the given Nullity is null;protected final int doSize()
AbstractStackStack.doSize in class AbstractStack<Payload>Stack.protected final void doPush(Payload payload)
AbstractStackdoPush in class AbstractStack<Payload>payload - The payload value to be pushed, which is guaranteed to be not
null, unless the Nullity of this
Stack is Nullity.ALLOW.protected final Payload doReplace(Payload replacement)
AbstractStackdoReplace in class AbstractStack<Payload>replacement - The replacement payload value to be used.protected final Payload doPop()
AbstractStackpushed)
payload value.
Only called if this AbstractStack is not empty.
doPop in class AbstractStack<Payload>protected final Payload doGetFirst()
AbstractStackpushed)
payload value.
Only called if this AbstractStack is not empty.
doGetFirst in class AbstractStack<Payload>protected final Source<Payload> doClear()
AbstractStackdoClear in class AbstractStack<Payload>Iterable that yields all removed payload values, even
after further structural modifications have been made to this
AbstractStack.protected final ProtectedIterator<Payload> doIterator()
AbstractStackProtectedIterator that starts with the
payload value at the given first index, where 0 is the index
of most recently pushed value.doIterator in class AbstractStack<Payload>ProtectedIterator.Copyright © 2016–2017 Markenwerk – Gesellschaft für markenbildende Maßnahmen mbH. All rights reserved.