X-Git-Url: https://xp-dev.com/git/RRRRHHHH_Code/blobdiff_plain/e3043c3b5cbff18b2388a9c95c411cc60367000d..b09f345318baa9ca734e11c87f52f8522d7cc1fb:/ruralHouses/src/domain/RuralHouse.java diff --git a/ruralHouses/src/domain/RuralHouse.java b/ruralHouses/src/domain/RuralHouse.java index 529f691..0c7fbb7 100644 --- a/ruralHouses/src/domain/RuralHouse.java +++ b/ruralHouses/src/domain/RuralHouse.java @@ -14,8 +14,7 @@ public class RuralHouse implements Serializable { private Owner owner; private String district; private HouseFeatures features; - private Vector offers; - private boolean isAccepted; + public Vector offers; public RuralHouse() { @@ -100,59 +99,7 @@ public class RuralHouse implements Serializable { return true; } - /** - * This method obtains available offers for a concrete house in a certain - * period - * - * @param houseName - * , the house number where the offers must be obtained - * @param firstDay - * , first day in a period range - * @param lastDay - * , last day in a period range - * @return a vector of offers(Offer class) available in this period - */ - public Vector getOffers(Date firstDay, Date lastDay) { - Vector availableOffers = new Vector(); - Iterator e = offers.iterator(); - Offer offer; - while (e.hasNext()) { - offer = e.next(); - if ((offer.getFirstDay().compareTo(firstDay) >= 0) - && (offer.getLastDay().compareTo(lastDay) <= 0) - && (!offer.isBooked())) - availableOffers.add(offer); - } - return availableOffers; - } - public Vector getAllOffers() { - - return this.offers; - } - - /** - * This method obtains the offer that match exactly with a given dates that - * has not been booked - * - * @param firstDay - * , first day in a period range - * @param lastDay - * , last day in a period range - * @return the offer(Offer class) available for a this period - */ - public Offer findOffer(Date firstDay, Date lastDay) { - Iterator e = offers.iterator(); - Offer offer = null; - while (e.hasNext()) { - offer = e.next(); - if ((offer.getFirstDay().compareTo(firstDay) == 0) - && (offer.getLastDay().compareTo(lastDay) == 0) - && (!offer.isBooked())) - return offer; - } - return null; - } public Offer overlapsWith(Date firstDay, Date lastDay) { @@ -167,13 +114,12 @@ public class RuralHouse implements Serializable { return null; } + - public boolean isAccepted() { - return isAccepted; - } + public Vector getAllOffers() { - public void setAccepted(boolean isAccepted) { - this.isAccepted = isAccepted; + return this.offers; } + }