Objective: Covers the usage of Exception handling, Inheritance, Interfaces, abstract classes, Sets and Maps

Description: Movie crew is a group of people hired by a production company for the purpose of producing a movie/film. The movie crew is divided into different departments, each of which specializes in a specific aspect of the movie production.

Create a package and name it enums.

Genre enum:
This enum contains the genre of a Movie with age-associated to it.

Constantage
BIOGRAPHY3
DRAMA5
FANTASY3
HORROR17
MYSTERY10
POETRY1
ROMANCE12
SCIENCE_FICTION8
THRILLER13

MPAA_Rating enum:

This enum contains the Motion Picture Association of America(MPAA) rating description and age restriction for DVD.

 

Constantdescriptionage
GGeneral Audiences0
NC_17Adults Only18
PGParental Guidance Suggested12
PG_13Parents Strongly Cautioned13
RRestricted17

Roles enum:

This enum contains different Roles in movie making.

 

Constant
DIRECTOR
PRODUCER
MUSIC_DIRECTOR
ART_DIRECTOR
ENGINEERING_SERVICES
SPECIAL_EFFECTS
MUSIC_EDITOR
VFX_ART_DIRECTOR
STUNT_COORDINATOR
STUNT_PERFORMER

Create a package and name it movies.

Person class:

This abstract class implements Comparable interface and will contain below attributes, shown in the table. All attributes are private.

 

AttributeTypeAttribute Description
firstNameStringFirst name of the person
lastNameStringLast name of the person

 

  1. Constructor: Two argument constructor to initialize all private instance variables.
  2. Write getter methods for the above-mentioned
  3. Generate hashCode and equals method for all private variables.
  4. Abstract Method:
    1. compareTo(Person): This method accepts Person object as a parameter.
  5. toString(): This method overrides the toString() of Person Please see sample output below.

Sample Output:

Prabas Raju

 Actor class:

This class extends person class and contains below private attributes.

AttributeTypeAttribute Description
ageintAge of an Actor
remunerationdoubleRemuneration of an Actor

 

  1. Constructor: Two argument constructor to initialize super class constructor and all private instance variables of Actor.
  2. Write getter methods for the above-mentioned
  3. compareTo(Person): This method accepts Person object as a parameter and compares based on the remuneration of Actor in descending order.
  4. toString(): This method overrides the toString() of Person Please see sample output below.

Sample Output:

Prabas Raju         Age: 28

Technician class:

This class extends person class and contains below private attributes.

 

AttributeTypeAttribute Description
roleRolesRole of a technician in the movie

 

  1. Constructor: One argument constructor to initialize super class constructor and all private instance variables of Technician.
  2. Write getter methods for the above mentioned
  3. compareTo(Person): This method accepts Person object as a parameter and compares based on Role of Technician.
  4. toString(): This method overrides the toString() of Person Please see sample output below.

Sample Output:

Rajamouli SS             DIRECTOR

 Movie class:

This class implements Comparable interface and will contain below private attributes.

 

AttributeTypeAttribute Description
titleStringTitle of the movie
genreGenreThe genre of the movie
ratingMPAA_RatingMPAA_Rating of the movie
collectionsdoublecollections collected by a movie in double
charactersHashMap<String,Actor>A unique set of character names with respective Actor

 

  1. Constructor: The four argument constructor will accept title, genre, rating and collections as parameters and will initialize all private variables of Movie.
  2. Write getter methods for the above-mentioned

Methods:

  1. addCharacter(String characterName, Actor actor): This method accepts character name of type String in the movie and respective Actor object as a parameter. This method adds given characters with respective Actors in
  2. compareTo(Genre): This method accepts Genre object as a parameter and compares to Genre of current
  3. toString(): This method overrides the toString() of Object Please see sample output below.

Sample Output:

Billa

Genre: Mystery      Rating: NC_17 (18 Years)

Collections: $100000000.00

Cast:

——————————————————

Character Played    Actor Name

——————————————————

Darling             Anushka Shetty

Ranga               Prabas Raju

MovieMapping class:

This class contains below private attributes.

AttributeTypeAttribute Description
movieMapHashMap<Movie, LinkedList<Person>>This attribute contains a set of movies and respective persons worked/acted in it.

 

  1. Constructor: No argument constructor to initialize all private variables of MovieMapping
  2. Write getter methods for the above-mentioned

Methods:

  1. addMovieCrewPerson (Movie movie, Person person): This method accepts Movie and Person objects as parameters. This method adds given Person to the list of persons of the given Movie in movieMap, if there is no existing list of persons for the given movie in movieMap then create a new LinkedList and add given Person to respective Movie.
  2. getListOfMoviesAPersonActed(String actorFullName): This method accepts actor name of type String. This method returns a list of Movies an actor acted.
    1. Format of actorFullName: ‚ÄúfirstName LastName‚ÄĚ
      • Example: Emma Watson
    2. getAllTechnicians (String movieName): This method accepts the movie name of type String. This method returns a list of Technicians who worked for the given movie.
    3. getListOfCharacterNames(String actor): This method accepts actor name of type String. This method returns a list of character names (of type String) for the given actor has acted in all movies in movieMap.
      1. Format of actor: ‚ÄúfirstName LastName‚ÄĚ
        • Example: Emma Watson
      2. getAllActors(): This method does not accept any parameters and returns a list of all the actors from all the movies in the movieMap
      3. toString(): This method overrides the toString() of Object Please see sample output below.

Sample Output:

******************************************************

Billa

Genre: Mystery      Rating: NC_17 (18 Years)

Collections: $100000000.00

Cast:

——————————————————

Character Played    Actor Name

——————————————————

Darling             Anushka Shetty

Ranga               Prabas Raju

——————————————————

Movie crew

——————————————————

Name           Role

——————————————————

Meher Ramesh             DIRECTOR

Mani Sharma              MUSIC_EDITOR

 

******************************************************

Bahubali

Genre: Drama        Rating: G (0 Years)

Collections: $130000000.00

Cast:

——————————————————

Character Played          Actor Name

——————————————————

Bhalaladeva              Rana Daggubati

Devasena                 Anushka Shetty

Amarendra Bahubali       Prabas Raju

——————————————————

Movie crew

——————————————————

Name           Role

——————————————————

Rajamouli SS             DIRECTOR

Keeravani MM             MUSIC_EDITOR

******************************************************

 

Note: Please note that the order doesn’t matter for list of actors from movies. As long as the number of values are matching.

Sample Output:

******************************************************

Details of all movies in mapper

******************************************************

Baahubali: The Beginning

Genre: DRAMA             Rating: G (0 Years)

Collections: $1040000000.00

Cast:

——————————————————

Character Played                        Actor Name

——————————————————

Shivudu / Baahubali                  Prabhas Raju

Kattappa                             Sathyaraj Rangaraj

Bhallaladeva                         Rana Daggubati

Avanthika                            Tamannaah Bhatia

Devasena                             Anushka Shetty

Shivagami                            Ramya Krishna

Bijjaladeva                          Nassar N

——————————————————

Movie crew

——————————————————

Name                                    Role

——————————————————

M.M. Keeravani                       MUSIC_DIRECTOR

Sabu Cyril                           ART_DIRECTOR

Yovko Dogandjiiski                   SPECIAL_EFFECTS

Adel Adili                           VFX_ART_DIRECTOR

Kaloian Vodenicharov                 STUNT_COORDINATOR

Lee Whittaker                        STUNT_COORDINATOR

Viktor Hristov                       STUNT_PERFORMER

Stilyan Mavrov                       STUNT_PERFORMER

******************************************************

Taare Zameen Par

Genre: DRAMA           Rating: PG (12 Years)

Collections: $12540000.00

Cast:

——————————————————

Character Played                        Actor Name

——————————————————

Maya Awasthi                         Tisca Chopra

Ishaan Awasthi                       Darsheel Safary

Ram Shankar Nikumbh                  Aamir Khan

——————————————————

Movie crew

——————————————————

Name                                    Role

——————————————————

Aamir Khan                           DIRECTOR

Ayush Ahuja                          SPECIAL_EFFECTS

******************************************************

Avengers: Infinity War

Genre: FANTASY         Rating: PG (12 Years)

Collections: $2047000000.00

Cast:

——————————————————

Character Played                        Actor Name

——————————————————

Loki                                 Tom Hiddleston

Steve Rogers / Captain America       Chris Evans

Nebula                               Karen Gillan

Wanda Maximoff / Scarlet Witch       Elizabeth Olsen

Peter Parker / Spider Man            Tom Holland

Tony Stark / Iron Man                Robert Downey

Doctor Strange                       Benedict Cumberbatch

Thor                                 Chris Hemsworth

Bruce Banner / Hulk                  Mark Ruffalo

Natasha Romanoff / Black Widow       Scarlett Johansson

James Rhodes / War Machine           Don Cheadle

Vision                               Paul Bettany

T’Challa / Black Panther¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬†¬† Chadwick Boseman

Sam Wilson / Falcon                  Anthony Mackie

Gamora                               Zoe Saldana

——————————————————

Movie crew

——————————————————

Name                                    Role

——————————————————

Anthony Russo                        DIRECTOR

Joe Russo                            DIRECTOR

Sean Ryan                            VFX_ART_DIRECTOR

Marija Juliette                      STUNT_PERFORMER

Chris Barnes                         STUNT_COORDINATOR

Steve Durkee                         MUSIC_EDITOR

******************************************************

Ye Maaya Chesave

Genre: ROMANCE      Rating: PG_13 (13 Years)

Collections: $2800000.00

Cast:

——————————————————

Character Played                        Actor Name

——————————————————

Karthik                              Naga Chaitanya

Jessie Thekekuttu                    Samantha Akkineni

——————————————————

Movie crew

——————————————————

Name                                    Role

——————————————————

Manjula Ghattamaneni                 PRODUCER

Allah-Rakha Rahman                   MUSIC_DIRECTOR

Rajeevan K                           ART_DIRECTOR

******************************************************

Billa

Genre: THRILLER        Rating: PG (12 Years)

Collections: $30900000.00

Cast:

——————————————————

Character Played                        Actor Name

——————————————————

Ranga / Billa                        Prabhas Raju

Maya                                 Anushka Shetty

——————————————————

Movie crew

——————————————————

Name                                    Role

——————————————————

Mehar Ramesh                         DIRECTOR

Stun Shiva                           STUNT_PERFORMER

Mani Sharma                          MUSIC_DIRECTOR

A.S. Prakash                         ART_DIRECTOR

 

******************************************************

All technicians mapped with in movie Avengers

******************************************************

Anthony Russo                        DIRECTOR

Joe Russo                            DIRECTOR

Sean Ryan                            VFX_ART_DIRECTOR

Marija Juliette                      STUNT_PERFORMER

Chris Barnes                         STUNT_COORDINATOR

Steve Durkee                         MUSIC_EDITOR

******************************************************

Character names of actor Prabas Raju in different movies

******************************************************

Ranga / Billa

Shivudu / Baahubali

******************************************************

List of movies Anushka Shetty acted

******************************************************

Baahubali: The Beginning

Billa

******************************************************

List of all actors from all movies in the map

******************************************************

Robert Downey                        Age: 50

Chris Hemsworth                      Age: 38

Benedict Cumberbatch                 Age: 45

Mark Ruffalo                         Age: 46

Chris Evans                          Age: 37

Paul Bettany                         Age: 42

Don Cheadle                          Age: 46

Elizabeth Olsen                      Age: 24

Scarlett Johansson                   Age: 35

Tom Hiddleston                       Age: 34

Chadwick Boseman                     Age: 30

Karen Gillan                         Age: 30

Zoe Saldana                          Age: 28

Tom Holland                          Age: 18

Prabhas Raju                         Age: 35

Rana Daggubati                       Age: 29

Anthony Mackie                       Age: 35

Nassar N                             Age: 62

Sathyaraj Rangaraj                   Age: 60

Ramya Krishna                        Age: 50

Aamir Khan                           Age: 58

Anushka Shetty                       Age: 30

Naga Chaitanya                       Age: 27

Tamannaah Bhatia                     Age: 29

Samantha Akkineni                    Age: 29

Darsheel Safary                      Age: 28

Tisca Chopra                         Age: 50

******************************************************

List of all movies sorted based on gross collections in descending order

******************************************************

Avengers: Infinity War               $2047000000.00

Baahubali: The Beginning             $1040000000.00

Billa                                $30900000.00

Taare Zameen Par                     $12540000.00

Ye Maaya Chesave                     $2800000.00

 

For Testing:

  • Create a source folder in the project and name it as test.
  • Now right click on MovieMapping class in src folder
  • Click on new -> Junit test case
  • Select New JUnit 4 test case
  • In source folder path, change src to test and click on finish.

Submit your solution by following the steps below:

  • Save your files in Eclipse.
  • Zip your entire Project. (It should be called LastnameAssignment02A.zip ¬†¬†¬†¬†¬†¬†¬†¬†¬†where the Last name is your last name.)
  • Generate Javadoc
  • Submit the Zip file to the Assignment02A.
  • Download the Zip file which you have submitted.
  • Look into the Zip file and verify the class files are updated. If not resave your project in Eclipse and resubmit.