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(); } }
public void excute() { previousSpeed = ceilingFan.getSpeed(); ceilingFan.medium(); }