-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAmplifier.java
More file actions
45 lines (33 loc) · 829 Bytes
/
Amplifier.java
File metadata and controls
45 lines (33 loc) · 829 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package FacadePattern;
public class Amplifier {
Tuner tuner;
DvdPlayer dvd;
CdPlayer cd;
public void on(){
System.out.println("Amplifier is on");
}
public void off(){
System.out.println("Amplifier is off");
}
public void setCd(CdPlayer cd){
this.cd = cd;
}
public void setDvd(DvdPlayer dvd){
this.dvd = dvd;
}
public void setStereoSound(){
System.out.println("Setting stereo sound");
}
public void setSurroundSound(){
System.out.println("Setting surround sound");
}
public void setTuner(Tuner tuner){
this.tuner = tuner;
}
public void setVolume(int volume){
System.out.println("Setting volume to " + volume);
}
public String toString(){
return "Amplifier";
}
}