public class LinkedStack<E>
extends java.util.LinkedList<E>
LinkedList,
Serialized Form| Constructor and Description |
|---|
LinkedStack()
Creates an empty Stack.
|
LinkedStack(java.util.Collection<? extends E> c)
Constructs a stack containing the elements of the specified collection,
in the order they are returned by the collection's iterator.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all the elements from this stack.
|
E |
peek()
Returns but does not remove the element at the top of this stack.
|
E |
pop()
Removes and returns the element at the top of this stack.
|
void |
push(E o)
Pushes an element onto the top of this stack.
|
add, add, addAll, addAll, addFirst, addLast, clone, contains, descendingIterator, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, offerFirst, offerLast, peekFirst, peekLast, poll, pollFirst, pollLast, remove, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, set, size, spliterator, toArray, toArraycontainsAll, isEmpty, removeAll, retainAll, toStringpublic LinkedStack()
public LinkedStack(java.util.Collection<? extends E> c)
c - the collection whose elements are to be placed into this stack.java.lang.NullPointerException - if the specified collection was null.