Implement the list calss, JAVA Programming

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.

Posted Date: 2/27/2013 7:00:16 AM | Location : United States







Related Discussions:- Implement the list calss, Assignment Help, Ask Question on Implement the list calss, Get Answer, Expert's Help, Implement the list calss Discussions

Write discussion on Implement the list calss
Your posts are moderated
Related Questions
Prototype is having multiple instances or having clone.

Inheritance - is the inclusion of state and behavior of a base class in a derived class so that they are accessible in that derived class. The key benefit of Inheritance is that

Implement a class  Book  (Book.java). A book will have three instance variables: a  title  (a String, for example: "Big Java" or "The Hitchhiker's Guide to the Galaxy"), an  author

Excel File to Responsive CSS/HTML page Project Description: Excel file to be converted into a responsive form for a site. In the excel file you will see where the input field

Write the JavaScript code for the Function SumOddNumbers(maxNumber) in which can add non-negative odd numbers up to maxNumber and return their sum. Java Script Code

Describe about basic java programming language? 1. Study the Java programming language: its syntax, patterns, idioms, and styles. 2. Become comfortable along with object orien

Spring - JSF integration is useful when an event handler wishes to explicitly invoke the bean factory to make beans on demand, such as a bean that encapsulates the business logic t

The different types of actions in Struts are: ? DispatchAction ? LookupDispatchAction ? ForwardAction ? SwitchAction ? IncludeAction

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

The formula for resistors linked in parallel is a little more complex. Given two resistors along with resistances R1 and R2 linked in parallel the equivalent resistance is given th