How can I access to the private fields of Java LinkedList Nodes?

surf4ads

New Member
I have to implement a board game, and it has 17 positions, and it is 'linked' like linked lists.So, I was planning to use LinkedList of ArrayList for this. (\[code\]LinkedList<ArrayList<String>>\[/code\] or sth...)However, it has two starting positions which merges after a few nodes, and players can opt which position they want to start from.(This means 'next' fields of two nodes point to one node, and a node might (but not necessary, I guess?) need two 'prev' fields.)Also, I want to have the 'next' field of an additional node next to the last position point to itself.In short, I want a collection class that is similar to LinkedList, but with some mutation.How might I be able to do this?My programming level is beginner~intermediate, and I have studied at LinkedList definitions similar to Java Collections Framework(but do not remember much of them...), and c++ std::list using textbooks.So my questions are these.Is it necessary for me to implement a simple List(and Node) class, and just create 18 Nodes and set these nodes' private fields in the way that I want to set, and add ArrayLists to its 'data' fields?Also, I was to use LinkedList of Stack(because I only need the latest-pushed element), but I felt it could be more useful if I just create private ArrayList classes and tailor it to my flavor, in a way similar to implementing Stack using ArrayList classes. How does it sound?What I am worried about is that I am not a very good programmer, and if I define them by myself, they can be unreliable, and the job may be very time-consuming too.(it has deadline)Is there any better way to achieve this?(like, maybe extending standard classes??not sure..)Any words of advice would be greatly appreciated.Thank you.
 
Back
Top