I want to iterate through a hashmap. I know I can easily use the entrySet. But the problem is I want to access two elements at once.
example:
HasHMap<Integer,Point> myMap = new HashMap<Integer,Point>();
//I add some points to the map where integer is the id of that point
I want to be able to access two elements at once so I can use the Graphics drawLine method.
I'm not sure if there's a way.
NOTE: I'm using a hashmap because it is easy to find any point by its id as my map has its polygons made from list of ids.