/*PLEASE DO NOT EDIT THIS CODE*/
/*This code was generated using the UMPLE @UMPLE_VERSION@ modeling language!*/

package example;

public class Switch
{

  //------------------------
  // MEMBER VARIABLES
  //------------------------

  //Switch State Machines
  private int status;

  // status constants
  private static final int On = 1;
  private static final int Off = 2;

  //------------------------
  // CONSTRUCTOR
  //------------------------

  public Switch()
  {
    status = On;
  }

  //------------------------
  // INTERFACE
  //------------------------

  public String getStatus()
  {
    switch (status)
    {
      case On: return "On";
      case Off: return "Off";
      default: return null;
    }
  }

  public boolean press()
  {
    switch (status)
    {
      case On:
        status = Off;
        keepDoing();
        status = doEnded;
        return true;
    }
    return false;
  }

  public void delete()
  {}

}
