Calc in Java based on Reverse Polish Notation