《java与模式》所有源代码

源代码在线查看: control.java

软件大小: 401 K
上传用户: zergwyk
关键词: java 模式 有源 代码
下载地址: 免注册下载 普通下载 VIP

相关代码

				package com.javapatterns.command.television;
				
				public class Control
				{    
				    /**
				     * @directed 
				     */
				    private Command onCommand, offCommand, changeChannel;
				
					public Control(Command on, Command off, Command channel)
				    {
						onCommand = on;
						offCommand = off;
				        changeChannel = channel;
					}
				
					public void turnOn()
				    {
						onCommand.execute() ;
					}
				
					public void turnOff()
				    {
						offCommand.execute();
					}
				
				    public void changeChannel()
				    {
				    	changeChannel.execute();
				    }
				}
				
							

相关资源