You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Movie class represents a movie with properties such as ID, title, description, and duration.
The Theater class represents a theater with properties such as ID, name, location, and a list of shows.
The Show class represents a movie show in a theater, with properties such as ID, movie, theater, start time, end time, and a map of seats.
The Seat class represents a seat in a show, with properties such as ID, row, column, type, price, and status.
The SeatType enum defines the different types of seats (normal or premium).
The SeatStatus enum defines the different statuses of a seat (available or booked).
The Booking class represents a booking made by a user, with properties such as ID, user, show, selected seats, total price, and status.
The BookingStatus enum defines the different statuses of a booking (pending, confirmed, or cancelled).
The User class represents a user of the booking system, with properties such as ID, name, and email.
The MovieTicketBookingSystem class is the main class that manages the movie ticket booking system. It follows the Singleton pattern to ensure only one instance of the system exists.
The MovieTicketBookingSystem class provides methods for adding movies, theaters, and shows, as well as booking tickets, confirming bookings, and cancelling bookings.
Multi-threading is achieved using concurrent data structures such as ConcurrentHashMap to handle concurrent access to shared resources like shows and bookings.
The MovieTicketBookingDemo class demonstrates the usage of the movie ticket booking system by adding movies, theaters, shows, booking tickets, and confirming or cancelling bookings.