Class Tables.Table

java.lang.Object
Tables.Table

public class Tables.Table extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    Tables.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 Type
    Method
    Description
    void
    addDish(int seat, String dish)
    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
    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.

    Methods inherited from class java.lang.Object

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

      public void addDish(int seat, String dish)
      Adds a dish to the table at the given seat.
      Parameters:
      seat - the seat number
      dish - the name of the dish
    • listDishes

      public String listDishes()
      Returns a string representation of the dishes at the table.
      Returns:
      a string representation of the dishes at the table