Package src.model

Class Cinema

Object
Cinema
All Implemented Interfaces:
Serializable, Comparable
Direct Known Subclasses:
IMaxCinema, PlatinumCinema, StandardCinema

public abstract class Cinema extends Object implements Comparable, Serializable
The Class that handles the data of Cinema
Version:
1.0
Author:
Lee Juin
See Also:
  • Constructor Details

    • Cinema

      public Cinema(String UUID, ArrayList<Seat> seats, int numOfRows, int totalNumOfSeats)
      Constructor for Cinema class
      Parameters:
      UUID - is the unique ID in the database
      seats - is all the Seat instances in the cinema
      numOfRows - is the total number of rows in the cinema
      totalNumOfSeats - is the total number of seats in the cinema
  • Method Details

    • getUUID

      public String getUUID()
      Gets the unique ID of the cinema
      Returns:
      Unique ID of the cinema
    • setUUID

      public void setUUID(String UUID)
      Sets the unique ID of the cinema
      Parameters:
      UUID - is the unique ID to be set
    • getCinemaClass

      public CinemaClass getCinemaClass()
      Gets the class of the cinema
      Returns:
      CinemaClass of the cinema
    • setCinemaClass

      public void setCinemaClass(CinemaClass cinemaClass)
      Sets the class of the cinema
      Parameters:
      cinemaClass - is the CinemaClass to be set
    • getSeats

      public ArrayList<Seat> getSeats()
      Gets all the Seat instances in the cinema
      Returns:
      ArrayList of Seat
    • duplicateSeats

      public ArrayList<Seat> duplicateSeats()
      Method to make a copy of the seats in the cinema
      Returns:
      ArrayList of Seat
    • setSeats

      public void setSeats(ArrayList<Seat> seats)
      Sets all the Seat instances in the cinema
      Parameters:
      seats - is the ArrayList of Seat instances to be set
    • addSeat

      public void addSeat(Seat seat)
      Method to add a seat into the cinema
      Parameters:
      seat - is the Seat instance to be added
    • getCinemaPrice

      public abstract double getCinemaPrice()
      Gets the price weight of the cinema
      Returns:
      Price weight of the cinema
    • setCinemaPrice

      public abstract void setCinemaPrice(double cinemaPrice)
      Sets the price weight of the cinema
      Parameters:
      cinemaPrice - is the price weight of the cinema to be set
    • getNumOfRows

      public int getNumOfRows()
      Gets the total number of rows of seats in the cinema
      Returns:
      The total number of rows
    • setNumOfRows

      public void setNumOfRows(int numOfRows)
      Sets the total number of rows of seats in the cinema
      Parameters:
      numOfRows - is the total number of rows to be set
    • getTotalNumOfSeats

      public int getTotalNumOfSeats()
      Gets the total number of seats in the cinema
      Returns:
      The total number of seats
    • setTotalNumOfSeats

      public void setTotalNumOfSeats(int totalNumOfSeats)
      Sets the total number of seats in the cinema
      Parameters:
      totalNumOfSeats - is the total number of seats to be set
    • compareTo

      public int compareTo(Object object)
      Method to compare between cinemas, sorted by UUID
      Specified by:
      compareTo in interface Comparable
      Parameters:
      object - is the cinema to be compared to
      Returns:
      More than zero if object is lower priority, equal to zero if equal priority, less than zero if object is higher priority