23种设计模式的java实现 include vistor,proxy,bridge

源代码在线查看: shop.java

软件大小: 616 K
上传用户: ZOUTING
关键词: include bridge vistor proxy
下载地址: 免注册下载 普通下载 VIP

相关代码

				/**
				 *  A concrete state for customer shopping
				 */
				import java.io.*;
				
				public class Shop extends ShopState {
				    public static boolean instanceFlag = false; //true if have 1 instance
				    private Shop() {
				    }
				    public static Shop getInstance() {
				        if(! instanceFlag) {
				            instanceFlag = true;
				            return new Shop();
				        }
				        return null;
				    }
				    public void shop() {
				        System.out.println("The state is shopping now !");
				    }
				}			

相关资源