/** * Wrapper around the int type to make it implement CalculatorOperand * and a toString method for printing * @author Leo Reyzin * */ public class MyInt implements CalculatorOperand { int theInteger; // holds the value /** * Constructor * @param i this will have the value i */ MyInt (int i) { theInteger = i; } /** * Adds addend to this * @param addend */ public void addTo (MyInt addend) { theInteger += addend.theInteger;; } /** * Subtracts subtrahend from this * @param subtrahend */ public void subtractFrom (MyInt subtrahend) { theInteger -= subtrahend.theInteger; }; /** * Multiplies this by multiplicand * @param multiplicand */ public void multiplyBy (MyInt multiplicand) { theInteger *= multiplicand.theInteger; } /** * @return Decimal representation of the value stored in this */ public String toString() {return theInteger + "";} }