?? dvdplayer.java
字號:
package headfirst.facade.hometheater;public class DvdPlayer { String description; int currentTrack; Amplifier amplifier; String movie; public DvdPlayer(String description, Amplifier amplifier) { this.description = description; this.amplifier = amplifier; } public void on() { System.out.println(description + " on"); } public void off() { System.out.println(description + " off"); } public void eject() { movie = null; System.out.println(description + " eject"); } public void play(String movie) { this.movie = movie; currentTrack = 0; System.out.println(description + " playing \"" + movie + "\""); } public void play(int track) { if (movie == null) { System.out.println(description + " can't play track " + track + " no dvd inserted"); } else { currentTrack = track; System.out.println(description + " playing track " + currentTrack + " of \"" + movie + "\""); } } public void stop() { currentTrack = 0; System.out.println(description + " stopped \"" + movie + "\""); } public void pause() { System.out.println(description + " paused \"" + movie + "\""); } public void setTwoChannelAudio() { System.out.println(description + " set two channel audio"); } public void setSurroundAudio() { System.out.println(description + " set surround audio"); } public String toString() { return description; }}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -