|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.AbstractSequentialList<E>
java.util.LinkedList<E>
fi.joensuu.cs.tra.LinkedStack<E>
public class LinkedStack<E>
LinkedStack extends java.util.LinkedList with behaviour expected of a Stack.
LinkedList
,
Serialized FormField Summary |
---|
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
LinkedStack()
Creates an empty Stack. |
|
LinkedStack(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. |
Method Summary | |
---|---|
void |
isEmpty()
Returns true if stack is empty |
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. |
Methods inherited from class java.util.LinkedList |
---|
add, add, addAll, addAll, addFirst, addLast, clear, clone, contains, element, get, getFirst, getLast, indexOf, lastIndexOf, listIterator, offer, poll, remove, remove, remove, removeFirst, removeLast, set, size, toArray, toArray |
Methods inherited from class java.util.AbstractSequentialList |
---|
iterator |
Methods inherited from class java.util.AbstractList |
---|
equals, hashCode, listIterator, removeRange, subList |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll, removeAll, retainAll, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
containsAll, equals, hashCode, iterator, listIterator, removeAll, retainAll, subList |
Constructor Detail |
---|
public LinkedStack()
public LinkedStack(Collection<? extends E> c)
c
- the collection whose elements are to be placed into this stack.
NullPointerException
- if the specified collection was null.Method Detail |
---|
public void push(E o)
o
- the element to be pushed onto this stack.public E pop()
public E peek()
peek
in interface Queue<E>
peek
in class LinkedList<E>
public void isEmpty()
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |