Class VisualizedStackOfNodes

java.lang.Object
  |
  +--VisualizedStackOfNodes

public class VisualizedStackOfNodes
extends Object

This is a Stack of Node objects that also draws the stack on a DrawingPane. The ExpressionVisualizer class is used to generate the expression strings displayed on the DrawingPane.


Constructor Summary
VisualizedStackOfNodes()
          Constructs a new empty stack.
 
Method Summary
 DrawingPane getDrawingPane()
          Returns the 310x140 DrawingPane that everything is drawn on.
 int getSize()
          Returns the number of items currently on the stack
 boolean isEmpty()
          Returns whether or not the stack is empty
 Node pop()
          Pops a node from the stack.
 void push(Node n)
          Pushes a Node onto the stack
 void setElispFix()
          Sets the display notation to Elisp
 void setInFix()
          Sets the display notation to Infix
 void setPostFix()
          Sets the display notation to Postfix
 void setPreFix()
          Sets the display notation to Prefix
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VisualizedStackOfNodes

public VisualizedStackOfNodes()
Constructs a new empty stack.
Method Detail

getSize

public int getSize()
Returns the number of items currently on the stack

isEmpty

public boolean isEmpty()
Returns whether or not the stack is empty

setInFix

public void setInFix()
Sets the display notation to Infix

setPostFix

public void setPostFix()
Sets the display notation to Postfix

setPreFix

public void setPreFix()
Sets the display notation to Prefix

setElispFix

public void setElispFix()
Sets the display notation to Elisp

getDrawingPane

public DrawingPane getDrawingPane()
Returns the 310x140 DrawingPane that everything is drawn on.

push

public void push(Node n)
Pushes a Node onto the stack

pop

public Node pop()
Pops a node from the stack. If the stack is empty, behavior is undefined.