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 阅读(495) 评论(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!!!  回复  更多评论   


只有注册用户登录后才能发表评论。


网站导航:
 
<2008年5月>
27282930123
45678910
11121314151617
18192021222324
25262728293031
1234567

导航

统计

常用链接

留言簿(1)

随笔档案

搜索

最新评论

阅读排行榜

评论排行榜