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;
23 public RuralHouse(String houseName, Owner owner, String description,
24 String ds, HouseFeatures features) {
25 this.houseName = houseName;
26 this.description = description;
29 this.features = features;
30 offers = new Vector<Offer>();
33 public String getHouseName() {
37 public void setHouseName(String houseName) {
38 this.houseName = houseName;
41 public String getDescription() {
45 public void setDescription(String description) {
46 this.description = description;
49 public Owner getOwner() {
53 public void setOwner(Owner owner) {
57 public String getDistrict() {
61 public void setDistrict(String ds) {
65 public HouseFeatures getFeatures() {
69 public void setFeatures(HouseFeatures features) {
70 this.features = features;
73 public String toString() {
74 return this.houseName + ": " + this.district;
77 public Offer createOffer(int offerNumber, Date firstDay, Date lastDay,
79 Offer off = new Offer(offerNumber, this, firstDay, lastDay, price);
85 public boolean equals(Object obj) {
90 if (getClass() != obj.getClass())
92 RuralHouse other = (RuralHouse) obj;
93 if (houseName == null) {
94 if (other.houseName != null)
96 } else if (!houseName.equals(other.houseName))
103 public Offer overlapsWith(Date firstDay, Date lastDay) {
105 Iterator<Offer> e = offers.iterator();
107 while (e.hasNext()) {
109 if ((offer.getFirstDay().compareTo(lastDay) < 0)
110 && (offer.getLastDay().compareTo(firstDay) > 0))
118 public Vector<Offer> getAllOffers() {