Package src.model
Class Cinema
Object
Cinema
- All Implemented Interfaces:
Serializable
,Comparable
- Direct Known Subclasses:
IMaxCinema
,PlatinumCinema
,StandardCinema
The Class that handles the data of Cinema
- Version:
- 1.0
- Author:
- Lee Juin
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Method to add a seat into the cinemaint
Method to compare between cinemas, sorted by UUIDMethod to make a copy of the seats in the cinemaGets the class of the cinemaabstract double
Gets the price weight of the cinemaint
Gets the total number of rows of seats in the cinemagetSeats()
Gets all theSeat
instances in the cinemaint
Gets the total number of seats in the cinemagetUUID()
Gets the unique ID of the cinemavoid
setCinemaClass
(CinemaClass cinemaClass) Sets the class of the cinemaabstract void
setCinemaPrice
(double cinemaPrice) Sets the price weight of the cinemavoid
setNumOfRows
(int numOfRows) Sets the total number of rows of seats in the cinemavoid
Sets all theSeat
instances in the cinemavoid
setTotalNumOfSeats
(int totalNumOfSeats) Sets the total number of seats in the cinemavoid
Sets the unique ID of the cinema
-
Constructor Details
-
Cinema
Constructor for Cinema class- Parameters:
UUID
- is the unique ID in the databaseseats
- is all theSeat
instances in the cinemanumOfRows
- is the total number of rows in the cinematotalNumOfSeats
- is the total number of seats in the cinema
-
-
Method Details
-
getUUID
Gets the unique ID of the cinema- Returns:
- Unique ID of the cinema
-
setUUID
Sets the unique ID of the cinema- Parameters:
UUID
- is the unique ID to be set
-
getCinemaClass
Gets the class of the cinema- Returns:
CinemaClass
of the cinema
-
setCinemaClass
Sets the class of the cinema- Parameters:
cinemaClass
- is theCinemaClass
to be set
-
getSeats
Gets all theSeat
instances in the cinema- Returns:
- ArrayList of
Seat
-
duplicateSeats
Method to make a copy of the seats in the cinema- Returns:
- ArrayList of
Seat
-
setSeats
Sets all theSeat
instances in the cinema- Parameters:
seats
- is the ArrayList ofSeat
instances to be set
-
addSeat
Method to add a seat into the cinema- Parameters:
seat
- is theSeat
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
Method to compare between cinemas, sorted by UUID- Specified by:
compareTo
in interfaceComparable
- 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
-