001package headfirst.proxy.javaproxy;
002
003public class PersonBeanImpl implements PersonBean {
004        String name;
005        String gender;
006        String interests;
007        int rating;
008        int ratingCount = 0;
009
010        public String getName() {
011                return name;
012        }
013
014        public String getGender() {
015                return gender;
016        }
017
018        public String getInterests() {
019                return interests;
020        }
021
022        public int getHotOrNotRating() {
023                if (ratingCount == 0) return 0;
024                return (rating/ratingCount);
025        }
026
027
028        public void setName(String name) {
029                this.name = name;
030        }
031
032        public void setGender(String gender) {
033                this.gender = gender;
034        }
035
036        public void setInterests(String interests) {
037                this.interests = interests;
038        }
039
040        public void setHotOrNotRating(int rating) {
041                this.rating += rating;
042                ratingCount++;
043        }
044}