Class CinemaHandler

java.lang.Object
moblima.control.handlers.ShowtimeHandler
moblima.control.handlers.CinemaHandler
Direct Known Subclasses:
BookingHandler

public class CinemaHandler extends ShowtimeHandler
The type Cinema handler.
  • Field Details

    • cinemas

      protected List<Cinema> cinemas
      The Cinemas.
    • cineplexCodes

      protected List<String> cineplexCodes
      The Cineplex codes.
    • selectedCinemaIdx

      protected int selectedCinemaIdx
      The Selected cinema idx.
  • Constructor Details

    • CinemaHandler

      public CinemaHandler()
      Instantiates a new Cinema handler.
  • Method Details

    • setSelectedCinemaId

      public void setSelectedCinemaId(int cinemaId)
      Sets selected cinema id.
      Parameters:
      cinemaId - the cinema id
    • getCinema

      public Cinema getCinema(int cinemaId)
      Gets cinema.
      Parameters:
      cinemaId - the cinema id
      Returns:
      the cinema
    • generateCinemas

      public List<Cinema> generateCinemas(int min)
      Generate cinemas list.
      Parameters:
      min - the min
      Returns:
      the list
    • generateShowtimes

      public List<Showtime> generateShowtimes(int min)
      Generate showtimes list.
      Parameters:
      min - the min
      Returns:
      the list
    • getCinemas

      public List<Cinema> getCinemas()
      Gets cinemas.
      Returns:
      the cinemas
    • updateCinema

      public boolean updateCinema(Cinema.ClassType classType, List<Showtime> showtimes, String cineplexCode)
      Update cinema boolean.
      Parameters:
      classType - the class type
      showtimes - the showtimes
      cineplexCode - the cineplex code
      Returns:
      the boolean
    • addCinema

      public int addCinema(Cinema.ClassType classType, List<Showtime> showtimes, String cineplexCode)
      Add cinema int.
      Parameters:
      classType - the class type
      showtimes - the showtimes
      cineplexCode - the cineplex code
      Returns:
      the int
    • removeCinema

      public boolean removeCinema(int cinemaId)
      Remove cinema boolean.
      Parameters:
      cinemaId - the cinema id
      Returns:
      the boolean
    • addShowtimes

      public boolean addShowtimes(int cinemaId, List<Showtime> showtimes)
      Add showtimes boolean.
      Parameters:
      cinemaId - the cinema id
      showtimes - the showtimes
      Returns:
      the boolean
    • getShowtimes

      public List<Showtime> getShowtimes()
      Gets showtimes.
      Returns:
      the showtimes
    • printedShowtime

      public String printedShowtime(String showtimeId)
      Printed showtime string.
      Parameters:
      showtimeId - the showtime id
      Returns:
      the string
    • getShowtimeCinema

      public Cinema getShowtimeCinema(String showtimeId)
      Gets showtime cinema.
      Parameters:
      showtimeId - the showtime id
      Returns:
      the showtime cinema
    • getCinemaShowtimes

      public List<Showtime> getCinemaShowtimes(int cinemaId)
      Gets cinema showtimes.
      Parameters:
      cinemaId - the cinema id
      Returns:
      the cinema showtimes
    • addShowtime

      public int addShowtime(int cinemaId, int movieId, LocalDateTime datetime, Showtime.ShowType type)
      Add showtime int.
      Parameters:
      cinemaId - the cinema id
      movieId - the movie id
      datetime - the datetime
      type - the type
      Returns:
      the int
    • checkClashingShowtime

      public boolean checkClashingShowtime(int cinemaId, LocalDateTime datetime)
      Check clashing showtime boolean.
      Parameters:
      cinemaId - the cinema id
      datetime - the datetime
      Returns:
      the boolean
    • getCineplexCinemas

      public List<Cinema> getCineplexCinemas(String cineplexCode)
      Gets cineplex cinemas.
      Parameters:
      cineplexCode - the cineplex code
      Returns:
      the cineplex cinemas
    • getCineplexCodes

      public List<String> getCineplexCodes()
      Get cineplex codes list.
      Returns:
      the list
    • addCineplexCode

      public void addCineplexCode(String cineplexCode)
      Add cineplex code.
      Parameters:
      cineplexCode - the cineplex code
    • printCineplex

      public String printCineplex(String cineplexCode)
      Print cineplex string.
      Parameters:
      cineplexCode - the cineplex code
      Returns:
      the string
    • getCinemaIdx

      public int getCinemaIdx(int cinemaId)
      Get cinema idx int.
      Parameters:
      cinemaId - the cinema id
      Returns:
      the int
    • updateShowtime

      public boolean updateShowtime(int cinemaId, int movieId, Showtime.ShowType showType, LocalDateTime datetime, boolean[][] seats)
      Update showtime boolean.
      Parameters:
      cinemaId - the cinema id
      movieId - the movie id
      showType - the show type
      datetime - the datetime
      seats - the seats
      Returns:
      the boolean
    • saveCinemas

      protected boolean saveCinemas()
      Save cinemas boolean.
      Returns:
      the boolean