RRRRHHHH_Code
Diff Revisions
7bf57b ...
vs
6a5d4d ...
for ruralHouses/src/domain/Offer.java
|
@@ -2,7 +2,6 @@ |
2 |
2 |
|
|
3 |
3 |
|
import java.io.Serializable; |
4 |
4 |
|
import java.util.Date; |
5 |
|
- |
import java.util.LinkedList; |
6 |
5 |
|
import java.util.Vector; |
7 |
6 |
|
|
8 |
7 |
|
|
|
@@ -13,8 +12,9 @@ |
13 |
12 |
|
private int offerNumber; |
14 |
13 |
|
private Date firstDay; // Dates are stored as java.util.Date objects instead of java.sql.Date objects |
15 |
14 |
|
private Date lastDay; // because, they are not well stored in db4o as java.util.Date objects |
16 |
|
- |
private float price; // This is coherent because objects of java.sql.Date are objects of java.util.Date |
17 |
|
- |
private Vector<Booking> bookings; // That is: java.sql.Date is a subclass (or extends) java.util.Date |
|
15 |
+ |
private float price; // This is coherent because objects of java.sql.Date are objects of java.util.Date � |
|
16 |
+ |
private boolean isBooked; |
|
17 |
+ |
private Vector<Booking> bookings = new Vector<Booking>(); // That is: java.sql.Date is a subclass (or extends) java.util.Date |
18 |
18 |
|
private RuralHouse ruralHouse; |
19 |
19 |
|
|
20 |
20 |
|
|
|
@@ -118,11 +118,10 @@ |
118 |
118 |
|
* @param First day, last day, house number and telephone |
119 |
119 |
|
* @return a book |
120 |
120 |
|
*/ |
121 |
|
- |
public Booking createBooking(int numBooking,String bookTelephoneNumber,String name , String mail) { |
122 |
|
- |
Client client = new Client(name,mail,bookTelephoneNumber); |
|
121 |
+ |
public Vector<Booking> createBooking(int numBooking,Client client) { |
123 |
122 |
|
Booking b = new Booking(numBooking,this,client); |
124 |
123 |
|
this.bookings.add(b); |
125 |
|
- |
return b; |
|
124 |
+ |
return this.bookings; |
126 |
125 |
|
|
127 |
126 |
|
} |
128 |
127 |
|
|
|
@@ -135,4 +134,10 @@ |
135 |
134 |
|
public void setBookings(Vector<Booking> bookings) { |
136 |
135 |
|
this.bookings = bookings; |
137 |
136 |
|
} |
|
137 |
+ |
public boolean isBooked() { |
|
138 |
+ |
return isBooked; |
|
139 |
+ |
} |
|
140 |
+ |
public void setBooked(boolean isBooked) { |
|
141 |
+ |
this.isBooked = isBooked; |
|
142 |
+ |
} |
138 |
143 |
|
} |