Implement the list calss, JAVA Programming

Assignment Help:

Your next task is to implement the MovieList class that manages the details for a list of DVD Movies read from the specified data file. The constructor will include a parameter that is the name of this data file (you will most likely use movies.txt as you develop your code, however I will test it with a different file name). The constructor must create an UnorderedLinkedList, open the named file, read lines from it, and add Movie objects with the details read from the file to the end of the list.

You also need to include methods that perform the following searches:  list the first 20 movies, returning their details in a string.

  • search for the movie with the specified catalog number, and return it's details in a string.
  • search for all movies whose year of release is between the supplied start and end years, and return their details in a string.
  • search for all movies that match the specified title, and return their details in a string.

Initially you should just check whether the title of each movie examined is the same as the one you are searching for. For maximum marks, rather than just comparing the titles to see if they are the same, you should treat the supplied search title as a pattern that can include "wildcards" (ie match a range of characters at that place). Hint. research the String matches() method and the Pattern class.

All of the above methods require you to traverse the list, examining each Movie object in turn to see whether the desired aspects match what you are searching for. To do this you need to use an Iterator (as provided in the LinkedIterator class) to scan the list. You need to examine the code in this class, and read the text on how it is used.

Further, once you have the above search methods working, you should modify them so that the 1st Movie object found is removed from its current location in the list, and inserted at the head of the list.

You should also include in this class a test main() method that creates a MovieList object from the specified data file, and then tests the key methods you have written for this class. The last method tested should be the list of the first 20 movies. Please ensure that this test code does not generate excessive amounts of output. Your code will be run from the command-line with arguments supplied naming:

the movie data file, a catalog number to search for, start and end years, and a title; looking something like:

java MovieList moremovies.txt 1055 1964 1966 "Toy Story"

You can either assume some sensible defaults if a parameter is not provided, or simply not do the relevant search if that is reasonable.


Related Discussions:- Implement the list calss

Develop billing software, Develop Billing Software Project Description: ...

Develop Billing Software Project Description: Need software to print bills on A4 paper in the format provided. The details are shown below - 1. Serially generated Invoice

Prepare a java program, Using Java, write the class Time which consists of ...

Using Java, write the class Time which consists of the following: (a) three private integer data members (hours, minutes and seconds). (b) a constructor to initialise the dat

Complete the implementation of the class, The class TurtleQTwo extends Turt...

The class TurtleQTwo extends Turtle by adding one new method, plus, which is specified below. (All other features of TurtleQTwo are the same as for Turtle.) method plus(n in

Publish subscribe model and p2p model, What is the basic difference among P...

What is the basic difference among Publish Subscribe model and P2P model? Ans) Publish Subscribe model is typically used in one-to-many situation. It is unreliable but very quic

Mention five applications of artificial intelligent system, Mention any fiv...

Mention any five applications of Artificial Intelligent System? 1)Medical Diagnosis 2)Robots 3) Games 4) Business intelligence 5)Image Recognition.

Online Music Store, Online music store that stores information about song, ...

Online music store that stores information about song, artist, album, customer, playlist. Also all necessary diagrams - use case, uml, erd

What is the role of hub in networks, What is the role of hub in networks? ...

What is the role of hub in networks? The network traffic controller - elements of convential computer networks. Hub is used to link the different computers within the network i

What is documentation for the class library, What is Documentation for the ...

What is Documentation for the class library Sun gives a large amount of documentation for the classes, interface's and exceptions in the class library. If you've installed the

Write a bouncing ball game, Write a bouncing ball video game. The game is s...

Write a bouncing ball video game. The game is similar to the one described and depicted in Figure of the text book. The balls bounces within the screen where the two horizontal wal

Difference between hashmap and hash table, Difference between HashMap and H...

Difference between HashMap and Hash table HashMap: It allow us to have null values and also one null key It is Unsynchronized. Iterator in HashMap is Fail-Safe.

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd