private String houseName;
private String description;
private Owner owner;
- private String town;
+ private String district;
private HouseFeatures features;
public Vector<Offer> offers;
public boolean isAccepted;
super();
}
- public RuralHouse(String houseName, Owner owner, String description, String town , HouseFeatures features) {
+ public RuralHouse(String houseName, Owner owner, String description, String ds , HouseFeatures features) {
this.houseName = houseName;
this.description = description;
this.owner = owner;
- this.town = town;
+ this.district = ds;
this.features = features;
offers=new Vector<Offer>();
}
this.owner=owner;
}
- public String getTown() {
- return town;
+ public String getDistrict() {
+ return district;
}
- public void setTown(String town) {
- this.town=town;
+ public void setDistrict(String ds) {
+ this.district=ds;
}
public HouseFeatures getFeatures() {
return features;
this.features = features;
}
public String toString() {
- return this.houseName + ": " + this.town;
+ return this.houseName + ": " + this.district;
}
public Offer createOffer(int offerNumber,Date firstDay, Date lastDay, float price) {
return availableOffers;
}
-
+ public Vector<Offer> getAllOffers() {
+ Vector<Offer> availableOffers=new Vector<Offer>();
+ Iterator<Offer> e=offers.iterator();
+ Offer offer;
+ while (e.hasNext()){
+ offer=e.next();
+ if ( (offer.getBooking()==null) )
+ availableOffers.add(offer);
+ }
+ return availableOffers;
+ }
/**
* This method obtains the offer that match exactly with a given dates that has not been booked
*
return null;
}
+
public Offer overlapsWith( Date firstDay, Date lastDay) {
Iterator<Offer> e=offers.iterator();