Class Customer

java.lang.Object
simu.model.Customer

public class Customer extends Object
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
    Constructor
    Description
    Constructs a Customer with the specified id.
  • Method Summary

    Modifier and Type
    Method
    Description
    double
    Returns the arrival time of the customer.
    double
    Returns the departure time of the customer.
    int
    Returns the group id of the customer.
    int
    Returns the id of the customer.
    boolean
    Returns whether the customer has ordered.
    boolean
    Returns whether the customer is leaving.
    boolean
    Returns whether the customer is seated.
    void
    order(Waiter waiter, MenuItem item)
    Orders the specified menu item from the waiter.
    void
    report(ControllerForFxml controllerForFxml)
    Reports the results of the simulation.
    void
    setArrivalTime(double arrivalTime)
    Sets the arrival time of the customer.
    void
    setDepartTime(double departTime)
    Sets the departure time of the customer.
    void
    setGroupId(int groupId)
    Sets the group id of the customer.
    void
    setHasOrdered(boolean hasOrdered)
    Sets whether the customer has ordered.
    void
    setLeaving(boolean leaving)
    Sets whether the customer is leaving.
    void
    setSeated(boolean seated)
    Sets whether the customer is seated.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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

      public void order(Waiter waiter, MenuItem item)
      Orders the specified menu item from the waiter.
      Parameters:
      waiter - the waiter to order from
      item - the menu item to order
    • getId

      public int getId()
      Returns the id of the customer.
      Returns:
      the id
    • report

      public void report(ControllerForFxml controllerForFxml)
      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