I have a nested map (map in/of map) with two string keys. Essentially what I do is that I have a set of nodes and I find the shortest route between them. However I need to store them and later use them, so I did the following:
private Map<String, Map<String,Object>> TravelTime =
new HashMap<String, Map<String,Object>>();
I use a loop to give values to this Map, where ParkingDests is a set of keys (String) of another HashMap:
ParkingDests = ParkingAttributes.keySet().size();
for (int i = 0;i< ParkingDests; i++){
for (int j = 0;j< ParkingDests; j++){
<code> TravelTime.put(keyone,keytwo,Shortest) </code>
}
}
I suppose what I need is something like:
TraveTime.put(ParkingDests(i),ParkingDest(j), ShortestRoute)
However I cannot find a way to do it. I am aware of the Guava Table (and I know that it is exactly what I need), however I would prefer to find a solution in this context.