House features gui created
[RRRRHHHH_Code] / ruralHouses / src / domain / RuralHouse.java
index 9b2ca05..423d5e7 100644 (file)
@@ -12,7 +12,7 @@ public class RuralHouse implements Serializable {
        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;
@@ -21,11 +21,11 @@ public class RuralHouse implements Serializable {
                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>();
        }
@@ -56,12 +56,12 @@ public class RuralHouse implements Serializable {
                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;
@@ -71,7 +71,7 @@ public class RuralHouse implements Serializable {
                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)  {
@@ -130,7 +130,17 @@ public class RuralHouse implements Serializable {
                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
         * 
@@ -149,6 +159,7 @@ public class RuralHouse implements Serializable {
                return null;            
        }
        
+       
 public Offer overlapsWith( Date firstDay,  Date lastDay) {
                
                Iterator<Offer> e=offers.iterator();