
public class ArithOperator 
{
    static class AO
    {
        private AO() {}
    }
    
    public static final AO PLUS = new AO();
    public static final AO MINUS = new AO();
    public static final AO TIMES = new AO();
    public static final AO DIVIDED_BY = new AO();
    
    public static final ArithOperator ADD = new ArithOperator(ArithOperator.PLUS);
    public static final ArithOperator SUB = new ArithOperator(ArithOperator.MINUS);
    public static final ArithOperator MUL = new ArithOperator(ArithOperator.TIMES);
    public static final ArithOperator DIV = new ArithOperator(ArithOperator.DIVIDED_BY);
    
    private AO myState;
    void setState(AO s)
    {
        myState = s;
    }
    
    public ArithOperator(ArithOperator a)
    {
        this.myState = a.myState;
    
		//{{INIT_CONTROLS
		//}}
	}
    
    public ArithOperator(AO s)
    {
        this.myState = s;
    }
    
    public ArithOperator(char c) throws BadOperatorException 
    {
        this(ArithOperator.PLUS);
        if (c == '+')
            this.myState = ArithOperator.PLUS;
        else if (c == '-')
            this.myState = ArithOperator.MINUS;
        else if (c == 'x')
            this.myState = ArithOperator.TIMES;
        else if (c == '/')
            this.myState = ArithOperator.DIVIDED_BY;
        else if (c == '*')
            this.myState = ArithOperator.TIMES;
        else if (c == '\\')
            this.myState = ArithOperator.DIVIDED_BY;
        else
            throw new BadOperatorException();
    }       
    
    public String toString () 
    {
        if (this.myState == ArithOperator.PLUS)
            return "+";
        else if (this.myState == ArithOperator.MINUS)
            return "-";
        else if (this.myState == ArithOperator.TIMES)
            return "x";
        else if (this.myState == ArithOperator.DIVIDED_BY)
            return "/";
        else
            return "";
    }
    
    public boolean is(AO x)
    {
        return(this.myState == x);
    }
	//{{DECLARE_CONTROLS
	//}}
}