| 5 | import BehaviouralDesignPatterns.CommandDesignPattern.WithoutCommandDesignPattern.AirConditioner; |
| 6 | |
| 7 | public class Main { |
| 8 | public static void main(String[] args) { |
| 9 | //AC Object |
| 10 | |
| 11 | AirConditioner AC = new AirConditioner(); |
| 12 | |
| 13 | |
| 14 | //RemoteControl |
| 15 | |
| 16 | MyRemoteControl remoteObj = new MyRemoteControl(); |
| 17 | |
| 18 | //create the command & press the button |
| 19 | remoteObj.setCommand(new TurnACOnCommandImpl(AC)); |
| 20 | |
| 21 | //users job is just to press the button. |
| 22 | |
| 23 | remoteObj.pressButton(); |
| 24 | |
| 25 | //undo the command |
| 26 | |
| 27 | remoteObj.undo(); |
| 28 | |
| 29 | } |
| 30 | |
| 31 | |
| 32 | } |
nothing calls this directly
no outgoing calls
no test coverage detected