ELEMENTTYPE - The type of the elements contained in the stack@NotThreadSafe public class NonBlockingStack<ELEMENTTYPE> extends ArrayList<ELEMENTTYPE> implements IHasSize, ICloneable<NonBlockingStack<ELEMENTTYPE>>
Vector but an
ArrayList 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(NonBlockingStack<? extends ELEMENTTYPE> aStack) |
| Modifier and Type | Method and Description |
|---|---|
static <ELEMENTTYPE> |
create() |
static <ELEMENTTYPE> |
create(Collection<? extends ELEMENTTYPE> aCont) |
static <ELEMENTTYPE> |
create(ELEMENTTYPE... aElements) |
static <ELEMENTTYPE> |
create(NonBlockingStack<? extends ELEMENTTYPE> aStack) |
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() |
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeRange, retainAll, set, size, subList, toArray, toArray, trimToSizecontainsAllfinalize, getClass, notify, notifyAll, wait, wait, waitcontainsAllpublic NonBlockingStack()
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<NonBlockingStack<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>@Nonnull public static <ELEMENTTYPE> NonBlockingStack<ELEMENTTYPE> create()
@Nonnull public static <ELEMENTTYPE> NonBlockingStack<ELEMENTTYPE> create(@Nullable ELEMENTTYPE... aElements)
@Nonnull public static <ELEMENTTYPE> NonBlockingStack<ELEMENTTYPE> create(@Nullable Collection<? extends ELEMENTTYPE> aCont)
@Nonnull public static <ELEMENTTYPE> NonBlockingStack<ELEMENTTYPE> create(@Nullable NonBlockingStack<? extends ELEMENTTYPE> aStack)
Copyright © 2006–2015 phloc systems. All rights reserved.