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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidMethod to add a seat into the cinemaintMethod to compare between cinemas, sorted by UUIDMethod to make a copy of the seats in the cinemaGets the class of the cinemaabstract doubleGets the price weight of the cinemaintGets the total number of rows of seats in the cinemagetSeats()Gets all theSeatinstances in the cinemaintGets the total number of seats in the cinemagetUUID()Gets the unique ID of the cinemavoidsetCinemaClass(CinemaClass cinemaClass) Sets the class of the cinemaabstract voidsetCinemaPrice(double cinemaPrice) Sets the price weight of the cinemavoidsetNumOfRows(int numOfRows) Sets the total number of rows of seats in the cinemavoidSets all theSeatinstances in the cinemavoidsetTotalNumOfSeats(int totalNumOfSeats) Sets the total number of seats in the cinemavoidSets the unique ID of the cinema
-
Constructor Details
-
Cinema
Constructor for Cinema class- Parameters:
UUID- is the unique ID in the databaseseats- is all theSeatinstances 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:
CinemaClassof the cinema
-
setCinemaClass
Sets the class of the cinema- Parameters:
cinemaClass- is theCinemaClassto be set
-
getSeats
Gets all theSeatinstances 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 theSeatinstances in the cinema- Parameters:
seats- is the ArrayList ofSeatinstances to be set
-
addSeat
Method to add a seat into the cinema- Parameters:
seat- is theSeatinstance 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:
compareToin 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
-