package provaFSM;



import nz.ac.waikato.modeljunit.Action;
import nz.ac.waikato.modeljunit.FsmModel;

public class onOff implements FsmModel {

	
	enum State{ON,OFF};
	State state;
	public onOff(){
		state=State.OFF;
	}
	
	@Override
	public Object getState() {
		// TODO Auto-generated method stub
		return state;
	}

	@Override
	public void reset(boolean arg0) {
		// TODO Auto-generated method stub
		state=state.OFF;
	}
    @Action
	public void change(){
    	System.out.println("cambio stato");
    	if(state==State.OFF) state=State.ON;
    	else state=State.OFF;
    }
	
    @Action
	public void on(){
           state=State.ON;
    }
    
    @Action
	public void off(){
           state=State.OFF;
    }
    

}
