Class Customer
java.lang.Object
simu.model.Customer
The Customer class represents a customer in the simulation.
It contains the arrival time, departure time, and the customer id.
It also contains methods to order food and report the results.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoubleReturns the arrival time of the customer.doubleReturns the departure time of the customer.intReturns the group id of the customer.intgetId()Returns the id of the customer.booleanReturns whether the customer has ordered.booleanReturns whether the customer is leaving.booleanisSeated()Returns whether the customer is seated.voidOrders the specified menu item from the waiter.voidreport(ControllerForFxml controllerForFxml) Reports the results of the simulation.voidsetArrivalTime(double arrivalTime) Sets the arrival time of the customer.voidsetDepartTime(double departTime) Sets the departure time of the customer.voidsetGroupId(int groupId) Sets the group id of the customer.voidsetHasOrdered(boolean hasOrdered) Sets whether the customer has ordered.voidsetLeaving(boolean leaving) Sets whether the customer is leaving.voidsetSeated(boolean seated) Sets whether the customer is seated.
-
Constructor Details
-
Customer
public Customer()Constructs a Customer with the specified id.
-
-
Method Details
-
getDepartTime
public double getDepartTime()Returns the departure time of the customer.- Returns:
- the departure time
-
setDepartTime
public void setDepartTime(double departTime) Sets the departure time of the customer.- Parameters:
departTime- the departure time
-
getArrivalTime
public double getArrivalTime()Returns the arrival time of the customer.- Returns:
- the arrival time
-
setArrivalTime
public void setArrivalTime(double arrivalTime) Sets the arrival time of the customer.- Parameters:
arrivalTime- the arrival time
-
order
-
getId
public int getId()Returns the id of the customer.- Returns:
- the id
-
report
Reports the results of the simulation.- Parameters:
controllerForFxml- the controller used to manage the simulation
-
hasOrdered
public boolean hasOrdered()Returns whether the customer has ordered.- Returns:
- true if the customer has ordered, false otherwise
-
setHasOrdered
public void setHasOrdered(boolean hasOrdered) Sets whether the customer has ordered.- Parameters:
hasOrdered- true if the customer has ordered, false otherwise
-
isLeaving
public boolean isLeaving()Returns whether the customer is leaving.- Returns:
- true if the customer is leaving, false otherwise
-
setLeaving
public void setLeaving(boolean leaving) Sets whether the customer is leaving.- Parameters:
leaving- true if the customer is leaving, false otherwise
-
isSeated
public boolean isSeated()Returns whether the customer is seated.- Returns:
- true if the customer is seated, false otherwise
-
setSeated
public void setSeated(boolean seated) Sets whether the customer is seated.- Parameters:
seated- true if the customer is seated, false otherwise
-
getGroupId
public int getGroupId()Returns the group id of the customer.- Returns:
- the group id
-
setGroupId
public void setGroupId(int groupId) Sets the group id of the customer.- Parameters:
groupId- the group id
-