-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCdPlayer.java
More file actions
41 lines (31 loc) · 819 Bytes
/
CdPlayer.java
File metadata and controls
41 lines (31 loc) · 819 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
package FacadePattern;
public class CdPlayer {
Amplifier amplifier;
String title;
public CdPlayer(Amplifier amplifier){
this.amplifier = amplifier;
}
public void on(){
System.out.println("CD Player is on");
}
public void off(){
System.out.println("CD Player is off");
}
public void eject(){
title = null;
System.out.println("CD Player eject");
}
public void play(String title){
this.title = title;
System.out.println("CD Player playing \"" + title + "\"");
}
public void stop(){
System.out.println("CD Player stopped");
}
public void pause(){
System.out.println("CD Player paused \"" + title + "\"");
}
public String toString(){
return "CD Player";
}
}