Package moblima.control.handlers
Class CinemaHandler
java.lang.Object
moblima.control.handlers.ShowtimeHandler
moblima.control.handlers.CinemaHandler
- Direct Known Subclasses:
BookingHandler
The type Cinema handler.
-
Field Summary
FieldsModifier and TypeFieldDescriptionThe Cinemas.The Cineplex codes.protected int
The Selected cinema idx.Fields inherited from class moblima.control.handlers.ShowtimeHandler
selectedShowtimeIdx, showtimes
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
addCinema
(Cinema.ClassType classType, List<Showtime> showtimes, String cineplexCode) Add cinema int.void
addCineplexCode
(String cineplexCode) Add cineplex code.int
addShowtime
(int cinemaId, int movieId, LocalDateTime datetime, Showtime.ShowType type) Add showtime int.boolean
addShowtimes
(int cinemaId, List<Showtime> showtimes) Add showtimes boolean.boolean
checkClashingShowtime
(int cinemaId, LocalDateTime datetime) Check clashing showtime boolean.generateCinemas
(int min) Generate cinemas list.generateShowtimes
(int min) Generate showtimes list.getCinema
(int cinemaId) Gets cinema.int
getCinemaIdx
(int cinemaId) Get cinema idx int.Gets cinemas.getCinemaShowtimes
(int cinemaId) Gets cinema showtimes.getCineplexCinemas
(String cineplexCode) Gets cineplex cinemas.Get cineplex codes list.getShowtimeCinema
(String showtimeId) Gets showtime cinema.Gets showtimes.printCineplex
(String cineplexCode) Print cineplex string.printedShowtime
(String showtimeId) Printed showtime string.boolean
removeCinema
(int cinemaId) Remove cinema boolean.protected boolean
Save cinemas boolean.void
setSelectedCinemaId
(int cinemaId) Sets selected cinema id.boolean
updateCinema
(Cinema.ClassType classType, List<Showtime> showtimes, String cineplexCode) Update cinema boolean.boolean
updateShowtime
(int cinemaId, int movieId, Showtime.ShowType showType, LocalDateTime datetime, boolean[][] seats) Update showtime boolean.Methods inherited from class moblima.control.handlers.ShowtimeHandler
assignSeat, assignSeat, bulkAssignSeat, getAvailableSeatCount, getShowtime, getShowtime, getShowtimeIdx, getShowtimes, printSeats, printSeats, printShowtimeDetails, removeShowtime, saveShowtimes, setSelectedShowtimeIdx, updateShowtimeSeats
-
Field Details
-
cinemas
The Cinemas. -
cineplexCodes
The Cineplex codes. -
selectedCinemaIdx
protected int selectedCinemaIdxThe 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
Gets cinema.- Parameters:
cinemaId
- the cinema id- Returns:
- the cinema
-
generateCinemas
Generate cinemas list.- Parameters:
min
- the min- Returns:
- the list
-
generateShowtimes
Generate showtimes list.- Parameters:
min
- the min- Returns:
- the list
-
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 typeshowtimes
- the showtimescineplexCode
- the cineplex code- Returns:
- the boolean
-
addCinema
Add cinema int.- Parameters:
classType
- the class typeshowtimes
- the showtimescineplexCode
- the cineplex code- Returns:
- the int
-
removeCinema
public boolean removeCinema(int cinemaId) Remove cinema boolean.- Parameters:
cinemaId
- the cinema id- Returns:
- the boolean
-
addShowtimes
Add showtimes boolean.- Parameters:
cinemaId
- the cinema idshowtimes
- the showtimes- Returns:
- the boolean
-
getShowtimes
Gets showtimes.- Returns:
- the showtimes
-
printedShowtime
Printed showtime string.- Parameters:
showtimeId
- the showtime id- Returns:
- the string
-
getShowtimeCinema
Gets showtime cinema.- Parameters:
showtimeId
- the showtime id- Returns:
- the showtime cinema
-
getCinemaShowtimes
Gets cinema showtimes.- Parameters:
cinemaId
- the cinema id- Returns:
- the cinema showtimes
-
addShowtime
Add showtime int.- Parameters:
cinemaId
- the cinema idmovieId
- the movie iddatetime
- the datetimetype
- the type- Returns:
- the int
-
checkClashingShowtime
Check clashing showtime boolean.- Parameters:
cinemaId
- the cinema iddatetime
- the datetime- Returns:
- the boolean
-
getCineplexCinemas
Gets cineplex cinemas.- Parameters:
cineplexCode
- the cineplex code- Returns:
- the cineplex cinemas
-
getCineplexCodes
Get cineplex codes list.- Returns:
- the list
-
addCineplexCode
Add cineplex code.- Parameters:
cineplexCode
- the cineplex code
-
printCineplex
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 idmovieId
- the movie idshowType
- the show typedatetime
- the datetimeseats
- the seats- Returns:
- the boolean
-
saveCinemas
protected boolean saveCinemas()Save cinemas boolean.- Returns:
- the boolean
-