RRRRHHHH_Code
Diff Revisions
0f75b2 ...
vs
7bf57b ...
for ruralHouses/src/domain/RuralHouse.java
|
@@ -130,28 +130,28 @@ |
130 |
130 |
|
return this.offers; |
131 |
131 |
|
} |
132 |
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.getBooking() == null)) |
151 |
|
- |
return offer; |
152 |
|
- |
} |
153 |
|
- |
return null; |
154 |
|
- |
} |
|
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.getBooking() == null)) |
|
151 |
+ |
// return offer; |
|
152 |
+ |
// } |
|
153 |
+ |
// return null; |
|
154 |
+ |
// } |
155 |
155 |
|
|
156 |
156 |
|
public Offer overlapsWith(Date firstDay, Date lastDay) { |
157 |
157 |
|
|