public class TreeShapedStack<T> extends Object
| Constructor and Description |
|---|
TreeShapedStack()
Creates an empty stack.
|
| Modifier and Type | Method and Description |
|---|---|
List<T> |
asList()
Returns the current stack as a list
|
boolean |
equals(Object o) |
int |
hashCode() |
T |
peek()
Returns the data in the top node of the stack.
|
TreeShapedStack<T> |
pop()
Returns the previous state.
|
TreeShapedStack<T> |
push(T data)
Returns a new node with the new data attached.
|
int |
size()
How many nodes in this branch of the stack
|
String |
toString() |
String |
toString(String delimiter) |
public TreeShapedStack<T> pop()
public TreeShapedStack<T> push(T data)
public T peek()
public int size()