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)
StackInterface
push
in interface StackInterface<T>
newEntry
- An object to be added to the stack.public T peek()
StackInterface
peek
in interface StackInterface<T>
public T pop()
StackInterface
pop
in interface StackInterface<T>
public boolean isEmpty()
StackInterface
isEmpty
in interface StackInterface<T>
public void clear()
StackInterface
clear
in interface StackInterface<T>