-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathReservation.java
35 lines (31 loc) · 1.06 KB
/
Reservation.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package Hotel;
import java.util.concurrent.atomic.*;
public class Reservation
{
private String customer;
private int rescode;
private int arrival;
private int resdays;
private int people;
private static AtomicInteger code = new AtomicInteger(-9);//âÜæïõìå -9 ãéáôß óôçí main öôéÜ÷íïõìå ðñþôá 10 äùìÜôéá, ïðüôå ï åðüìåíïò áñéèìüò èá Þôáí ôï 10
Room room;
public int getRescode(){return rescode;}
public String getCustomer(){return customer;}
public void setCustomer(String a){customer=a;}
public int getArrival(){return arrival;}
public void setArrival(int a){arrival=a;}
public int getResdays(){return resdays;}
public void setResdays(int b){resdays=b;}
public int getPeople(){return people;}
public void setPeople(int c){people=c;}
public Room getRoom(){return room;}
public Reservation()//constructor ðïõ åîáóöáëéæåé ïôé êáèå áíôéêåéìåíï èá å÷åé äéáöïñåôéêï reservation code
{
this.room=null;
rescode= code.getAndIncrement();
}
public void setRoom(Room nroom)//ïñéæåé room ãéá ôï reservation
{
this.room=nroom;
}
}