public class RPNCalc
extends java.lang.Object
Constructor and Description |
---|
RPNCalc()
Get a stack (one of three implementations) from the stack factory.
|
Modifier and Type | Method and Description |
---|---|
void |
add()
The operation removes two objects from the stack.
|
void |
assign()
The operation removes two objects from the stack.
|
boolean |
calcNotEmpty()
pre: none
post: tells us if the calculator has an empty stack.
|
void |
divide()
The operation removes two objects from the stack.
|
static void |
main(java.lang.String[] a)
This main routine is used for testing the RPNCalc.
|
void |
multiply()
The operation removes two objects from the stack.
|
void |
number(java.lang.Object item)
Pre: there is room in the calculator's stack.
|
java.lang.Object |
pop()
This method always returns a value.
|
void |
raise()
The operation removes two objects from the stack.
|
void |
subtract()
The operation removes two objects from the stack.
|
java.lang.Object |
top()
Examine (but do not remove) the top value of the calculator's stack.
|
public RPNCalc()
public boolean calcNotEmpty()
public void add()
public void raise()
public void subtract()
public void divide()
public void multiply()
public void number(java.lang.Object item)
public void assign()
public java.lang.Object top()
public java.lang.Object pop()
public static void main(java.lang.String[] a)