forked from BenjaminChun/OODP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Table.java
73 lines (64 loc) · 1.46 KB
/
Table.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
/**
* Represents a Table in the restaurant.
* Table can have different number of seats,
* status and ID.
* @author Benjamin Chun Wei Jie
* @version 14
* @since 2021-11-13
*/
public class Table {
/**
* The seating capacity of the Table
*/
private int seatingCapacity;
/**
* The status of the Table (AVAILABLE,
* OCCUPIED, RESERVED).
*/
private Status status;
/**
* The ID of the table.
*/
private int tableID;
/**
* Creates a Table object.
* The table can only have 2/4/6/8/10 seats.
* Table status can only be chosen from the Status class.
* @param tableID This Table's ID
* @param seatingCapacity This Table's seating capacity.
* @param status This Table's status.
*/
public Table(int tableID, int seatingCapacity, Status status) {
this.tableID = tableID;
this.seatingCapacity = seatingCapacity;
this.status = status;
}
/**
* Get the seating capacity of the Table.
* @return The seating capacity of the Table.
*/
public int getSeatingCapacity() {
return this.seatingCapacity;
}
/**
* Set the Table status.
* @param status The new status of the Table.
*/
public void setStatus(Status status) {
this.status = status;
}
/**
* Get the Table status.
* @return The Table status.
*/
public Status getStatus() {
return status;
}
/**
* Get the tableID.
* @return tableID of the Table.
*/
public int getId(){
return tableID;
}
}