Class Tables.Table
java.lang.Object
Tables.Table
-
Constructor Summary
ConstructorsConstructorDescriptionTables.Table
(int tableNumber) Constructs a new Tables.Table object with the given table number and initializes the dishes HashMap with empty strings. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a dish to the table at the given seat.int
Returns the table number.int
Returns the number of seats taken at the table.boolean
isFilled()
Returns whether the table is currently filled.Returns a string representation of the dishes at the table.void
setFilled
(boolean filled) Sets the table's filled status to the given boolean value.void
setSeatsFilled
(int seatsFilled) Sets the number of seats filled at the table to the given value.
-
Constructor Details
-
Tables.Table
public Tables.Table(int tableNumber) Constructs a new Tables.Table object with the given table number and initializes the dishes HashMap with empty strings.- Parameters:
tableNumber
- the table number
-
-
Method Details
-
getNumber
public int getNumber()Returns the table number.- Returns:
- the table number
-
setFilled
public void setFilled(boolean filled) Sets the table's filled status to the given boolean value.- Parameters:
filled
- the filled status of the table
-
isFilled
public boolean isFilled()Returns whether the table is currently filled.- Returns:
- true if the table is filled, false otherwise
-
setSeatsFilled
public void setSeatsFilled(int seatsFilled) Sets the number of seats filled at the table to the given value.- Parameters:
seatsFilled
- the number of seats filled at the table
-
getSeatsTaken
public int getSeatsTaken()Returns the number of seats taken at the table.- Returns:
- the number of seats taken at the table
-
addDish
Adds a dish to the table at the given seat.- Parameters:
seat
- the seat numberdish
- the name of the dish
-
listDishes
Returns a string representation of the dishes at the table.- Returns:
- a string representation of the dishes at the table
-