spring的最新用法...牛!!!

            1
            2import org.springframework.beans.BeanUtils;    
            3
            4   
            5public class People {     
            6    public class Contants {     
            7        public static final int 情人節 = 120;     
            8             
            9        public static final int THING_ROSE = 1;     
           10        public static final int THING_KISS = 2;     
           11        public static final int THING_HUG = 3;     
           12        public static final int THING_ANGRY = 4;     
           13        public static final int THING_OTHER = 5;     
           14             
           15        public static final double MONEY = 100000.00;     
           16        public static final int LOVE = 100;     
           17        public static final int AGE = 30;     
           18             
           19    }
               
           20    public static  class Boy {     
           21        private boolean 有車;     
           22        private boolean 有房;     
           23        private double 賺錢;     
           24        private int 年齡 = 15;     
           25             
           26        public Boy() {     
           27            super();     
           28        }
               
           29        public Boy(boolean isOwnCar,boolean isOwnHouse) {     
           30            有車 = isOwnCar;     
           31            有房 = isOwnHouse;     
           32        }
               
           33        public Boy(boolean isOwnCar,boolean isOwnHouse,double partMoeny) {     
           34            有車 = isOwnCar;     
           35            有房 = isOwnHouse;     
           36            賺錢 = partMoeny;     
           37        }
               
           38             
           39        public void setBoy(Boy boy) {     
           40            BeanUtils.copyProperties(this, boy);     
           41        }
               
           42        public boolean  givegirl(int thing) {     
           43            switch(thing) {     
           44            case Contants.THING_ROSE:     
           45            case Contants.THING_KISS:     
           46            case Contants.THING_HUG:     
           47                return true;     
           48            case Contants.THING_ANGRY:     
           49            case Contants.THING_OTHER:     
           50                return false;     
           51            }
               
           52            return false;     
           53        }
               
           54        public void 拼命賺錢() {     
           55            賺錢 ++;     
           56        }
               
           57        public int get年齡() {     
           58            return 年齡;     
           59        }
               
           60        public void set年齡(int 年齡) {     
           61            this.年齡 = 年齡;     
           62        }
               
           63        public boolean is有車() {     
           64            return 有車;     
           65        }
               
           66        public void set有車(boolean 有車) {     
           67            this.有車 = 有車;     
           68        }
               
           69        public double get賺錢() {     
           70            return 賺錢;     
           71        }
               
           72        public void set賺錢(double 賺錢) {     
           73            this.賺錢 = 賺錢;     
           74        }
               
           75        public boolean is有房() {     
           76            return 有房;     
           77        }
               
           78        public void set有房(boolean 有房) {     
           79            this.有房 = 有房;     
           80        }
               
           81             
           82    }
               
           83    public static  class Girl {     
           84        private boolean 等;     
           85        private int 感情;     
           86        private int 生日;     
           87             
           88             
           89        public Boy 嫁給(Boy boy) {     
           90            return boy;     
           91        }
               
           92        public boolean is等() {     
           93            return 等;     
           94        }
               
           95        public void set等(boolean 等) {     
           96            this.等 = 等;     
           97        }
               
           98        public int get感情() {     
           99            return 感情;     
          100        }
               
          101        public void set感情(int 感情) {     
          102            this.感情 = 感情;     
          103        }
               
          104        public int get生日() {     
          105            return 生日;     
          106        }
               
          107        public void set生日(int 生日) {     
          108            this.生日 = 生日;     
          109        }
               
          110    }
               
          111         
          112    public  boolean loveLoad(Boy boy,Girl girl) {     
          113        if (boy.is有房() && boy.is有車()) {     
          114            boy.setBoy(null);     
          115            girl.嫁給(boy);     
          116        }
           else {     
          117            if(girl.is等()) {     
          118                System.out.println("====1");     
          119                while (! (boy.get賺錢() > Contants.MONEY && girl.感情 > Contants.LOVE && boy.get年齡() < Contants.AGE)) {     
          120                    System.out.println("====2");     
          121                    for(int day = 1; day < 365 ; day ++{     
          122                        System.out.println("====3");     
          123                        if(day == Contants.情人節) {     
          124                            if(boy.givegirl(Contants.THING_ROSE)) {     
          125                                girl.set感情(girl.get感情() + 1);     
          126                            }
           else {     
          127                                girl.set感情(girl.get感情() - 1);     
          128                            }
               
          129                        }
               
          130                        if(day == girl.get生日()) {     
          131                            if(boy.givegirl(Contants.THING_ROSE)) {     
          132                                girl.set感情(girl.get感情() + 1);     
          133                            }
           else {     
          134                                girl.set感情(girl.get感情() - 1);     
          135                            }
               
          136                        }
               
          137                        boy.拼命賺錢();     
          138                    }
               
          139                    if(boy.is有房() && boy.is有車()) {     
          140                        boy.setBoy(null);     
          141                        girl.嫁給(boy);     
          142                        return true;     
          143                    }
               
          144                    boy.set年齡(boy.get年齡() + 1);     
          145                    girl.set感情(girl.get感情() - 1);     
          146                }
               
          147                if(boy.get年齡() > Contants.AGE) {     
          148                    girl.嫁給(new Boy());     
          149                    return false;     
          150                }
               
          151            }
           else {     
          152                girl.嫁給(new Boy());     
          153                return false;     
          154            }
               
          155        }
               
          156        return false;     
          157    }
               
          158    public  static void main(String []args) {     
          159        People people = new People();     
          160        Boy litterBoy = new Boy();     
          161        litterBoy.set年齡(15);     
          162        litterBoy.set有房(false);     
          163        litterBoy.set有車(false);     
          164        litterBoy.set賺錢(0.00);     
          165        Girl goodGirl = new Girl();     
          166        goodGirl.set生日(100);     
          167        goodGirl.set感情(0);     
          168        goodGirl.set等(true);     
          169        System.out.println(people.loveLoad(litterBoy, goodGirl));     
          170    }
           
          171
          172

          posted on 2008-05-03 14:28 ljgBean 閱讀(542) 評論(6)  編輯  收藏

          評論

          # re: spring的最新用法...牛!!! 2008-05-03 14:55 山風小子

          呵呵~被忽悠了 :)  回復  更多評論   

          # re: spring的最新用法...牛!!! 2008-05-03 20:57 BeanSoft

          !!!騙子!  回復  更多評論   

          # re: spring的最新用法...牛!!![未登錄] 2008-05-04 11:01 apple0668

          天啊,今天不是愚人節啊!被忽悠了。  回復  更多評論   

          # re: spring的最新用法...牛!!! 2008-05-04 14:45 三人行,必有我師焉

          常量拼寫是constant  回復  更多評論   

          # re: spring的最新用法...牛!!! 2008-11-11 15:09 你爹爹

          你媽個傻B,這東西幾十年前老子就寫過了。
          你看你寫的垃圾,關spring屁事啊。  回復  更多評論   

          # re: spring的最新用法...牛!!! 2010-02-03 14:03 nk

          怎么不關Spring的事?發春,發Spring!!!  回復  更多評論   


          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          <2010年2月>
          31123456
          78910111213
          14151617181920
          21222324252627
          28123456
          78910111213

          導航

          統計

          常用鏈接

          留言簿(1)

          隨筆檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 三亚市| 沈阳市| 凉城县| 榆树市| 舞钢市| 龙岩市| 准格尔旗| 宜都市| 库伦旗| 灌阳县| 香港| 青岛市| 平南县| 永新县| 莆田市| 玉环县| 芮城县| 辽中县| 新民市| 乐都县| 武定县| 天台县| 留坝县| 蓬溪县| 商河县| 马公市| 江永县| 长海县| 民权县| 康平县| 武穴市| 扎鲁特旗| 祁东县| 沙田区| 喀喇沁旗| 随州市| 潮安县| 察雅县| 龙陵县| 舟曲县| 买车|