ELEMENTTYPE - The type of the elements contained in the stack@NotThreadSafe public class NonBlockingStack<ELEMENTTYPE> extends CommonsArrayList<ELEMENTTYPE>
Vector but an
CommonsArrayList as the underlying data structure as opposed to
Stack. This spares us from unnecessary synchronization.modCount| Constructor and Description |
|---|
NonBlockingStack() |
NonBlockingStack(Collection<? extends ELEMENTTYPE> aCollection) |
NonBlockingStack(ELEMENTTYPE... aElements) |
NonBlockingStack(int nInitialCapacity) |
NonBlockingStack(NonBlockingStack<? extends ELEMENTTYPE> aStack) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
ELEMENTTYPE |
firstElement() |
NonBlockingStack<ELEMENTTYPE> |
getClone() |
int |
hashCode() |
ELEMENTTYPE |
peek()
Looks at the object at the top of this stack without removing it from the
stack.
|
ELEMENTTYPE |
pop()
Removes the object at the top of this stack and returns that object as the
value of this function.
|
ELEMENTTYPE |
push(ELEMENTTYPE aItem)
Pushes an item onto the top of this stack.
|
ELEMENTTYPE |
replaceTopElement(ELEMENTTYPE aItem)
Replaces the top element in the stack.
|
ELEMENTTYPE |
top()
Looks at the object at the top of this stack without removing it from the
stack.
|
String |
toString() |
createFiltered, createFiltered, createFiltered, createFiltered, createFiltered, createFiltered, createInstanceadd, add, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizecontainsAllfinalize, getClass, notify, notifyAll, wait, wait, waitgetAll, getAllInstanceOf, getAllMapped, getAllMapped, getAsUnmodifiable, getAtIndex, getFirst, getFirst, getLast, getLast, getSortedInline, removeAndReturnElementAtIndex, removeAtIndex, removeFirst, removeLast, reverse, setFirst, setLast, swapItemsadd, add, addAll, addAll, clear, contains, containsAll, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArrayaddAll, addAll, addAll, addAll, addAll, addAll, addAll, addAll, addAllMapped, addAllMapped, addAllMapped, addAllMapped, addAllMapped, addAllMapped, addIf, addIfNotNull, addObject, getAtIndex, getAtIndex, getAtIndex, getAtIndexMapped, getAtIndexMapped, getAtIndexMapped, getAtIndexMapped, getCopyAsList, getCount, getSorted, iterator2, removeAll, removeObject, set, setAll, setAll, setAllMapped, setAllMappedparallelStream, removeIf, streamcontainsAny, containsNone, containsOnly, findAll, findAllInstanceOf, findAllMapped, findAllMapped, findAllMapped, findFirst, findFirst, findFirstIndex, findFirstMapped, findFirstMapped, findLastIndex, forEach, forEachBreakable, forEachByIndex, getCountisEmpty, isNotEmpty, sizepublic NonBlockingStack()
public NonBlockingStack(@Nonnegative int nInitialCapacity)
@SafeVarargs public NonBlockingStack(@Nullable ELEMENTTYPE... aElements)
public NonBlockingStack(@Nullable Collection<? extends ELEMENTTYPE> aCollection)
public NonBlockingStack(@Nullable NonBlockingStack<? extends ELEMENTTYPE> aStack)
@Nullable public ELEMENTTYPE push(@Nullable ELEMENTTYPE aItem)
aItem - the item to be pushed onto this stack.aItem argument.@Nullable public ELEMENTTYPE pop()
EmptyStackException - if this stack is empty.@Nullable public ELEMENTTYPE peek()
EmptyStackException - if this stack is empty.@Nullable public ELEMENTTYPE top()
peek()EmptyStackException - if this stack is empty.peek()@Nullable public ELEMENTTYPE firstElement()
peek() delivering the last element.EmptyStackException - if the stack is empty@Nullable public ELEMENTTYPE replaceTopElement(@Nullable ELEMENTTYPE aItem)
pop (); push (aItem);aItem - the item to be pushed onto this stack.aItem argument.EmptyStackException - if the stack is empty@Nonnull public NonBlockingStack<ELEMENTTYPE> getClone()
getClone in interface ICloneable<ICommonsList<ELEMENTTYPE>>getClone in class CommonsArrayList<ELEMENTTYPE>public boolean equals(Object o)
equals in interface Collection<ELEMENTTYPE>equals in interface List<ELEMENTTYPE>equals in class AbstractList<ELEMENTTYPE>public int hashCode()
hashCode in interface Collection<ELEMENTTYPE>hashCode in interface List<ELEMENTTYPE>hashCode in class AbstractList<ELEMENTTYPE>public String toString()
toString in class AbstractCollection<ELEMENTTYPE>Copyright © 2014–2020 Philip Helger. All rights reserved.