public class TreeShapedStack<T>
extends java.lang.Object
| Constructor and Description |
|---|
TreeShapedStack()
Creates an empty stack.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<T> |
asList()
Returns the current stack as a list
|
boolean |
equals(java.lang.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
|
java.lang.String |
toString() |
java.lang.String |
toString(java.lang.String delimiter) |
public TreeShapedStack<T> pop()
public TreeShapedStack<T> push(T data)
public T peek()
public int size()
public java.util.List<T> asList()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString(java.lang.String delimiter)
public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Object