📄 keypad.java
字号:
package com.javapatterns.command.audioplayer;
/**
* This is the Invoker role
*/
public class Keypad
{
/**
* @link aggregation
*/
private Command playCmd;
/**
* @link aggregation
*/
private Command rewindCmd;
/**
* @link aggregation
*/
private Command stopCmd;
public Keypad(Command play, Command stop, Command rewind)
{
// concrete Command registers itself with the invoker
playCmd = play;
stopCmd = stop;
rewindCmd = rewind;
}
public void play()
{
playCmd.execute();
}
public void stop()
{
stopCmd.execute();
}
public void rewind()
{
rewindCmd.execute();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -