
212
6
章
リモコンをテストする
public class RemoteLoader {
public static void main(String[] args) {
RemoteControl remoteControl = new RemoteControl();
Light livingRoomLight = new Light("
リビングルーム
");
Light kitchenLight = new Light("
キッチン
");
CeilingFan ceilingFan= new CeilingFan("
リビングルーム
");
GarageDoor garageDoor = new GarageDoor("
ガレージ
");
Stereo stereo = new Stereo("
リビングルーム
");
LightOnCommand livingRoomLightOn =
new LightOnCommand(livingRoomLight);
LightOffCommand livingRoomLightOff =
new LightOffCommand(livingRoomLight);
LightOnCommand kitchenLightOn =
new LightOnCommand(kitchenLight);
LightOffCommand kitchenLightOff =
new LightOffCommand(kitchenLight);
CeilingFanOnCommand ...