3 import java.io.Serializable;
5 import java.util.Iterator;
6 import java.util.Vector;
8 public class RuralHouse implements Serializable {
10 private static final long serialVersionUID = 1L;
12 private String houseName;
13 private String description;
15 private String district;
16 private HouseFeatures features;
17 public Vector<Offer> offers;
24 public RuralHouse(String houseName, Owner owner, String description,
25 String ds, HouseFeatures features) {
26 this.houseName = houseName;
27 this.description = description;
30 this.features = features;
31 offers = new Vector<Offer>();
34 public String getHouseName() {
38 public void setHouseName(String houseName) {
39 this.houseName = houseName;
42 public String getDescription() {
46 public void setDescription(String description) {
47 this.description = description;
50 public Owner getOwner() {
54 public void setOwner(Owner owner) {
58 public String getDistrict() {
62 public void setDistrict(String ds) {
66 public HouseFeatures getFeatures() {
70 public void setFeatures(HouseFeatures features) {
71 this.features = features;
74 public String toString() {
75 return this.houseName + ": " + this.district;
78 public Offer createOffer(int offerNumber, Date firstDay, Date lastDay,
80 Offer off = new Offer(offerNumber, this, firstDay, lastDay, price);
86 public boolean equals(Object obj) {
91 if (getClass() != obj.getClass())
93 RuralHouse other = (RuralHouse) obj;
94 if (houseName == null) {
95 if (other.houseName != null)
97 } else if (!houseName.equals(other.houseName))
104 public Offer overlapsWith(Date firstDay, Date lastDay) {
106 Iterator<Offer> e = offers.iterator();
108 while (e.hasNext()) {
110 if ((offer.getFirstDay().compareTo(lastDay) < 0)
111 && (offer.getLastDay().compareTo(firstDay) > 0))
119 public Vector<Offer> getAllOffers() {