We're going to begin work on Minibrowse, the next generation web browser and search engine. For this assignment, you will start with the core Minibrowse code and add functionality to display a history window that displays the previous 5 web sites that the user has visited. You will do this by implementing a custom DoublyLinkedList class subject to specifications.
Copy MinibrowseCore.java and Minibrowse.java to your own directory, compile all the code (javac *.java), and run Minibrowse (java Minibrowse). Type in a URL at the top, and hit Enter to get the web page to render. Enjoy the poor rendering that you see, and appreciate the power of "real" web browsers. Nonetheless, this is a great platform on which we can build. Look carefully at the code of Minibrowse.java to get an understanding of how it works. Try deleting lines or modifying them, and see how it affects your program.
MinibrowseCore.java is the "black box" code (kind of like Canvas.java) that you don't need to be concerned with how it works, but I have supplied it anyway in case you're curious. But all of the work that you're actually doing will be in Minibrowse.java.
Create a class called DoublyLinkedList<E> that uses generic types. Use whatever methods you think are appropriate, but read ahead to the next part of this assignment to get a sense of what you'll need to do with it. Your linked list should be doubly linked, i.e. each node in the list should link to the node that follows it and the node that precedes it. You must construct your linked list code "from scratch." You should not use classes from the Java Collections Framework such as LinkedList or other similar classes you may find. This is so that you can gain the valuable experience of constructing a linked list yourself. Once this assignment is complete and turned in, you will be free to use the standard LinkedList class on future homework assignments.
Modify Minibrowse so that it maintains a list of the last 5 web pages that the user has previously visited. Once the list is full, whenever the user goes to a web page you should delete the oldest one and insert the newest one. You should do this efficiently. Do not worry about duplicates; if the user goes to the same web page more than once, add it to the history list more than once.
Add two buttons to the Minibrowse window. A button labeled "History+" should display the 5 most recent web pages to the terminal window, with the most recent on top and the least recent on the bottom. Another button labeled "History-" should act similarly, but should show the least recent web page on top and the most recent on the bottom. Since your list is linked in both directions, you should not need to resort your data in any way. Instead, you should be able to traverse your list in one direction or the other as necessary.
The changes that you need to make to Minibrowse.java
should be minimal, and just reflect the new user interface
updates. Most of your work will be in the DoublyLinkedList
Part 1: You should turn in a design document for the project. This one page document should list what methods you will need for your DoublyLinkedList class, what instance variables your class will need, how you will test your code, and how long the effort will take you.
Part 2: Create your DoublyLinkedList class. This is just a single file. It should have a main method that inserts and removes some Strings to demonstrate that it actually works. Think carefully about what kinds of cases you should be testing, and what methods will make sense in order to be able to integrate this with Minibrowse later.
Part 3: Turn in the complete project, which includes MinibrowseCore.java (unchanged), Minibrowse.java, and DoublyLinkedList.java.
Have fun!