锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久免费视频1,欧美日韩最好看的视频,欧美电影一二区http://www.aygfsteel.com/simonshen/category/48249.htmlzh-cnThu, 07 Apr 2011 16:33:19 GMTThu, 07 Apr 2011 16:33:19 GMT60瑙傚療鑰呮ā寮?/title><link>http://www.aygfsteel.com/simonshen/archive/2011/04/07/347745.html</link><dc:creator>simon.shen</dc:creator><author>simon.shen</author><pubDate>Thu, 07 Apr 2011 14:29:00 GMT</pubDate><guid>http://www.aygfsteel.com/simonshen/archive/2011/04/07/347745.html</guid><wfw:comment>http://www.aygfsteel.com/simonshen/comments/347745.html</wfw:comment><comments>http://www.aygfsteel.com/simonshen/archive/2011/04/07/347745.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/simonshen/comments/commentRss/347745.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/simonshen/services/trackbacks/347745.html</trackback:ping><description><![CDATA[     鎽樿:     姒傚康錛氳瀵熻呮ā寮忓畾涔変簡涓瀵瑰渚濊禆錛岃繖鏍蜂竴鏉ワ紝褰撲竴涓璞℃敼鍙樼姸鎬佹椂錛屽畠鐨勬墍鏈変緷璧栬呴兘浼氭敹鍒伴氱煡騫惰嚜鍔ㄦ洿鏂般?     涓句釜緗戜笂鍟嗗煄鐨勪緥瀛愶紝姣斿寰堝欏懼瀵規煇涓晢鍝佹劅鍏磋叮錛屾妸鍟嗗搧鏀惰棌錛屽綋璇ュ晢鍝侀檷浠楓佷績閿銆佹湁璐т簡絳変簨浠跺彂鐢熸椂錛屽氨浼氬彂Email閫氱煡欏懼銆?     UML鍥?..  <a href='http://www.aygfsteel.com/simonshen/archive/2011/04/07/347745.html'>闃呰鍏ㄦ枃</a><img src ="http://www.aygfsteel.com/simonshen/aggbug/347745.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/simonshen/" target="_blank">simon.shen</a> 2011-04-07 22:29 <a href="http://www.aygfsteel.com/simonshen/archive/2011/04/07/347745.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>絳栫暐妯″紡http://www.aygfsteel.com/simonshen/archive/2011/04/06/347744.htmlsimon.shensimon.shenWed, 06 Apr 2011 14:56:00 GMThttp://www.aygfsteel.com/simonshen/archive/2011/04/06/347744.htmlhttp://www.aygfsteel.com/simonshen/comments/347744.htmlhttp://www.aygfsteel.com/simonshen/archive/2011/04/06/347744.html#Feedback0http://www.aygfsteel.com/simonshen/comments/commentRss/347744.htmlhttp://www.aygfsteel.com/simonshen/services/trackbacks/347744.html    浠庝粖澶╁紑濮嬶紝鎶婂父鐢ㄧ殑璁捐妯″紡閮界畝鍗曠殑鏁寸悊涓閬嶏紝甯屾湜姣忎釜鏄熸湡鑳借嚦灝戞暣鐞?涓ā寮忓惂錛屽厛浠庣畝鍗曠殑絳栫暐妯″紡寮濮嬨?br />     
    姒傚康錛?/strong>瀹冨畾涔変簡涓緋誨垪鐨勭畻娉曪紝騫跺皢姣忎竴涓畻娉曞皝瑁呰搗鏉ワ紝鑰屼笖浣垮畠浠繕鍙互鐩鎬簰鏇挎崲銆傜瓥鐣ユā寮忚綆楁硶鐨勫彉鍖栦笉浼氬獎鍝嶅埌浣跨敤綆楁硶鐨勫鎴楓?br />     
    絳栫暐妯″紡寰堢畝鍗曪紝瀹為檯涓婂氨鏄疧O涓殑澶氭侊紝涓句釜渚嬪瓙錛屾煇鍟嗗満瑕佽繘琛屼績閿錛屽浜庢櫘閫氶【瀹㈡墦88鎶橈紝瀵逛簬閾跺崱瀹㈡埛鍦?8鎶樺熀紜涓婂啀婊?00鍑?60錛屽浜庨噾鍗″鎴峰湪88鎶樺熀紜涓婂啀婊?00鍑?00銆?br />     
    
UML鍥懼涓嬫墍紺猴細
    

    鎺ュ彛DiscountStrategy浠g爜濡備笅錛?br />     
public interface DiscountStrategy {
    
public double discount(double
 sum);
}

    綾籊eneralDiscountStrategy綾諱唬鐮佸涓嬶細
    
public class GeneralDiscountStrategy implements DiscountStrategy {

    @Override
    
public double discount(double sum) 
{
        
return sum * 0.88
;
    }


}

    綾籗ilverDiscountStrategy綾諱唬鐮佸涓嬶細
    
public class SilverDiscountStrategy implements DiscountStrategy {

    @Override
    
public double discount(double sum) 
{
        sum 
= sum * 0.88
;
        
int t = (int) sum / 400
;
        sum 
= sum - t * 160
;
        
return
 sum;
    }

}

    綾籊oldenDiscountStrategy浠g爜濡備笅錛?br />     
public class GoldenDiscountStrategy implements DiscountStrategy {

    @Override
    
public double discount(double sum) 
{
        sum 
= sum * 0.88
;
        
int t = (int) sum / 400
;
        sum 
= sum - t * 200
;
        
return
 sum;
    }

}

    綾籆ashier浠g爜濡備笅錛?br />     
public class Cashier {
    
private DiscountStrategy discountStrategy = new
 GeneralDiscountStrategy();

    
public void getDiscountStrategy(CustomerLevel customerLevel) 
{
        
switch (customerLevel) 
{
            
case
 GENERAL:
                discountStrategy 
= new
 GeneralDiscountStrategy();
                
break
;
            
case
 SILVER:
                discountStrategy 
= new
 SilverDiscountStrategy();
                
break
;
            
case
 GOLDEN:
                discountStrategy 
= new
 GeneralDiscountStrategy();
                
break
;
        }

    }


    
public double calculate(double price, int num) {
        
return discountStrategy.discount(price *
 num);
    }

}


]]>
主站蜘蛛池模板: 台南市| 西安市| 定西市| 黄山市| 武川县| 凌云县| 邢台县| 深水埗区| 徐闻县| 许昌市| 浦北县| 太湖县| 雅江县| 巴彦淖尔市| 旅游| 扎鲁特旗| 宜昌市| 天台县| 湖口县| 镇江市| 义乌市| 慈利县| 县级市| 贵阳市| 西平县| 永康市| 沙雅县| 巫山县| 神池县| 民丰县| 乳山市| 乌拉特中旗| 峨边| 禹州市| 清原| 神农架林区| 万荣县| 长汀县| 望城县| 玉溪市| 临夏市|