用户工具


class Ring{
    public void turnOn() {};
    public void turnOff() {};
}
class Alarm{
    public void turnOn() {};
    public void turnOff() {};
}
class Light{
    public void turnOn() {};
    public void turnOff() {};
}

public class Facade {

    private Ring ring;
    private Alarm clarm;
    private Light light;

    public Facade(Ring ring, Alarm clarm, Light light) {
        this.ring = ring;
        this.clarm = clarm;
        this.light = light;
    }

    public void open() {
        light.turnOn();
        ring.turnOn();
        clarm.turnOn();
    }

    public void close() {
        light.turnOff();
        ring.turnOff();
        clarm.turnOff();
    }
}