public final class LinkedStack<T> extends java.lang.Object implements StackInterface<T>
| Constructor and Description |
|---|
LinkedStack() |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all entries from this stack.
|
boolean |
isEmpty()
Detects whether this stack is empty.
|
T |
peek()
Retrieves this stack's top entry.
|
T |
pop()
Removes and returns this stack's top entry.
|
void |
push(T newEntry)
Adds a new entry to the top of this stack.
|
public void push(T newEntry)
StackInterfacepush in interface StackInterface<T>newEntry - An object to be added to the stack.public T peek()
StackInterfacepeek in interface StackInterface<T>public T pop()
StackInterfacepop in interface StackInterface<T>public boolean isEmpty()
StackInterfaceisEmpty in interface StackInterface<T>public void clear()
StackInterfaceclear in interface StackInterface<T>