• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

Linked list Help

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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]
 
Let's go to the waterfront with this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic