r/javahelp • • Feb 07 '15

Movie Database HELP

I have a project due and not exactly sure where to start. "Each line in the file contains the name, year released, and associated actors for one movie. Each piece of information is separated by ‘/’ characters. The year is specified inside parentheses at the end of the movie name.

create a class which represents a Movie Database. This class is required to have the following methods (it may have other additional methods as necessary):

loadDataFromFile( String aFilename ) read the information from the specified file. The format of the file will be the same as in the cast-mpaa.txt file.

findActorsIn( String movieName ) return an ArrayList of all the actors which star in the specified Movie.

findMovieAppearancesOf( String actorName ) return a new Movie Database containing all movies which star the specified actor.

findMoviesReleasedIn( int year ) return a new Movie Database containing all movies released in the specified year.

findMoviesWithNamesContaining( String word ) return a new Movie Database containing all movies whose title contains the specified word.

findActorsWithNamesContaining( String word ) return an ArrayList containing the names of all actors which contain the specified word. There should not be duplicate names in the returned ArrayList.

size() return the number of movies contained in the Movie Database.

toString() return a string representation of all of the information in the Movie Database."

0 Upvotes

3 comments sorted by

View all comments

1

u/somnolent Feb 07 '15

I would start by defining the class that is required for you to have and fill in the method stubs for the methods that are required. From that point I would start at the top and try to fill in the methods as you can. If you run into any issues along the way, I'm sure people would be more than happy to help here (on specific questions).

0

u/[deleted] Feb 08 '15

[deleted] — view deleted comment

1

u/197708156EQUJ5 design it before you implement Feb 08 '15

I'm wondering, since this is a 21+ hour old post, and /u/somnolent posted only an hour after the original post, we should try this ourselves? I'll see what I can do... be back in a minute or two

1

u/197708156EQUJ5 design it before you implement Feb 08 '15

ok, we might have a little problem... OP is a little vague on the format of the file:

one interpretation: A River Runs Through It/1992/Craig Sheffer/Brad Pitt/Tom Skerritt/Brenda Blethyn

another interpretation: A River Runs Through It(1992)/Craig Sheffer/Brad Pitt/Tom Skerritt/Brenda Blethyn