www.pudn.com > 23种设计模式的java实现.zip > Text.java


/** 
 *  The Abstract of Text  
 */ 
public abstract class Text  { 
    public abstract void DrawText(String text); 
    protected TextImp GetTextImp(String type) { 
        if(type.equals("Mac")) { 
            return new TextImpMac(); 
        } else if(type.equals("Linux")) { 
            return new TextImpLinux(); 
        } else { 
            return new TextImpMac(); 
        } 
    } 
}