You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
881 B
32 lines
881 B
/**
|
|
* 智能家居控制中心类
|
|
* 可以根据设备的不同接口类型调用相应的功能
|
|
*/
|
|
public class SmartHomeControlCenter {
|
|
private String name;
|
|
|
|
public SmartHomeControlCenter(String name) {
|
|
this.name = name;
|
|
}
|
|
|
|
/**
|
|
* 控制可打印设备
|
|
* @param printable 可打印设备
|
|
*/
|
|
public void controlPrintable(Printable printable) {
|
|
System.out.println(name + " 控制中心正在控制打印设备...");
|
|
printable.print();
|
|
}
|
|
|
|
/**
|
|
* 控制多功能设备
|
|
* @param device 多功能设备
|
|
*/
|
|
public void controlMultifunctionalDevice(MultifunctionalDevice device) {
|
|
System.out.println(name + " 控制中心正在控制多功能设备...");
|
|
// 测试多功能设备的各种功能
|
|
device.print();
|
|
device.scan();
|
|
device.copy();
|
|
}
|
|
} |