예제 #1
0
 public void undo()
 {
     if (previousSpeed == CeilingFan.HIGH)
     {
         ceilingFan.high();
     }
     else if (previousSpeed == CeilingFan.MEDIUM)
     {
         ceilingFan.medium();
     }
     else if (previousSpeed == CeilingFan.LOW)
     {
         ceilingFan.low();
     }
     else if (previousSpeed == CeilingFan.OFF)
     {
         ceilingFan.off();
     }
 }
예제 #2
0
 public void excute()
 {
     previousSpeed = ceilingFan.getSpeed();
     ceilingFan.high();
 }