Git Repository Public Repository

RRRRHHHH_Code

URLs

Copy to Clipboard

Diff Revisions e3043c ... vs b09f34 ... for ruralHouses client/src/domain/RuralHouse.java

Diff revisions: vs.
  @@ -14,8 +14,8 @@
14 14 private Owner owner;
15 15 private String district;
16 16 private HouseFeatures features;
17 - private Vector<Offer> offers;
18 - private boolean isAccepted;
17 + public Vector<Offer> offers;
18 +
19 19
20 20 public RuralHouse() {
21 21 super();
  @@ -99,59 +99,7 @@
99 99 return true;
100 100 }
101 101
102 - /**
103 - * This method obtains available offers for a concrete house in a certain
104 - * period
105 - *
106 - * @param houseName
107 - * , the house number where the offers must be obtained
108 - * @param firstDay
109 - * , first day in a period range
110 - * @param lastDay
111 - * , last day in a period range
112 - * @return a vector of offers(Offer class) available in this period
113 - */
114 - public Vector<Offer> getOffers(Date firstDay, Date lastDay) {
115 - Vector<Offer> availableOffers = new Vector<Offer>();
116 - Iterator<Offer> e = offers.iterator();
117 - Offer offer;
118 - while (e.hasNext()) {
119 - offer = e.next();
120 - if ((offer.getFirstDay().compareTo(firstDay) >= 0)
121 - && (offer.getLastDay().compareTo(lastDay) <= 0)
122 - && (!offer.isBooked()))
123 - availableOffers.add(offer);
124 - }
125 - return availableOffers;
126 - }
127 -
128 - public Vector<Offer> getAllOffers() {
129 102
130 - return this.offers;
131 - }
132 -
133 - /**
134 - * This method obtains the offer that match exactly with a given dates that
135 - * has not been booked
136 - *
137 - * @param firstDay
138 - * , first day in a period range
139 - * @param lastDay
140 - * , last day in a period range
141 - * @return the offer(Offer class) available for a this period
142 - */
143 - public Offer findOffer(Date firstDay, Date lastDay) {
144 - Iterator<Offer> e = offers.iterator();
145 - Offer offer = null;
146 - while (e.hasNext()) {
147 - offer = e.next();
148 - if ((offer.getFirstDay().compareTo(firstDay) == 0)
149 - && (offer.getLastDay().compareTo(lastDay) == 0)
150 - && (!offer.isBooked()))
151 - return offer;
152 - }
153 - return null;
154 - }
155 103
156 104 public Offer overlapsWith(Date firstDay, Date lastDay) {
157 105
  @@ -166,13 +114,12 @@
166 114 return null;
167 115
168 116 }
117 +
169 118
170 - public boolean isAccepted() {
171 - return isAccepted;
172 - }
119 + public Vector<Offer> getAllOffers() {
173 120
174 - public void setAccepted(boolean isAccepted) {
175 - this.isAccepted = isAccepted;
121 + return this.offers;
176 122 }
177 123
124 +
178 125 }