⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 keypad.java

📁 这个文件里面包含了java设计模式的一些例子讲解
💻 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 + -