Campbell Ritchie wrote:Welcome to JavaRanch
Don't know, but if you look through the Map interface in the API and Java™ Tutorials, it supports mapping from one key to one value. A TreeMap keeps its keys sorted by natural order. So I doubt whether you can use a Map directly to map from a node to the next node.
You can probably easily set up a Map<Node, List<Node>> however, which maps from a Node to a List of Nodes associated with that Node. That might help.
Too difficult a question for "beginning Java". Moving thread.
We find this kind of rampant individuality very disturbing. But not this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|