📄 warehouse.java~9~
字号:
package securitysystem;public class Warehouse extends SecurityZone{ /** * This method is called by the notify method so that this * object can have a chance to handle measurements. */ boolean handleNotification(int measurement, Sensor sensor) { return false; } // handleNotification(int, Sensor) void fireAlarm(SecurityZone zone,Sensor sensor) { if (zone instanceof Area) { // Turn on sprinklers in surrounding areas // Don't call super.fireAlarm because that will turn on the // sprinkler for the whole warehouse. System.out.print("Fireman go to "+this.name+"'s "+zone.name); if (getParent() != null) getParent().fireAlarm(zone,sensor); return; } // if super.fireAlarm(zone,sensor); } // fireAlarm(SecurityZone) public Warehouse(String string) { super(string); } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -