my dog learned polymorphism*
The moose likes Beginning Java and the fly likes Linked list Help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Linked list Help" Watch "Linked list Help" New topic
Author

Linked list Help

Sarah Mukherjee
Greenhorn

Joined: Feb 26, 2011
Posts: 1
Hi, I need to create a notepad program, which is essentially a linked list of nodes, where each node is a linked list of nodes. The "inner" list is for storing a "note" (each line of the note will be stored in a node of this list and can be either a String or an Integer). The "outer" is a list of these notes. I have to make a generic class, so I have the G<T> class for the Object data, GNode<T> class for the node, GList<T> class for the list, and my MyMain class for the main method.
Below are the classes. I am not sure how to go about this!! How do I store a string or integer as a node and keep it as a linked list within a linked list? I know I have a printList and setEntry compiling error in my main method (the only errors so far), and I would like help with that, but more with the actual concept and how to go about it. I may not need to fix those errors if they are not needed the way I wrote them. This is as far as I've gotten.

---------------------------------------------------------The MyMain Class


---------------------------------------------------------The GList<T> Class

---------------------------------------------------------The GNode<T> Class

---------------------------------------------------------The G<T> Class


[Edit: put code between [code] and [/code] ubb code blocks]
 
Don't get me started about those stupid light bulbs.
 
subject: Linked list Help