Guest User

Untitled

a guest
Jan 20th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. Map<Integer, GeoPoint> mapPoints = new HashMap<Integer, GeoPoint>();
  2. ArrayList<Integer> keys2 = new ArrayList<Integer>(mapPoints.keySet());
  3.  
  4. for (int t =0; t < 50; t ++){
  5.  
  6. Collections.shuffle(keys2);
  7.  
  8. }
  9.  
  10. Map<Integer, GeoPoint> mapPoints = new HashMap<Integer, GeoPoint>();
  11. System.out.println("before shuffle ");
  12. Set<Integer> keys = mapPoints.keySet();
  13. for (int key : keys) {
  14. System.out.println("key : " + key + " value: " + mapPoints.get(key));
  15. }
  16. Collections.shuffle(keys); // don't know why multiple shuffles are required. deck of cards?
  17. System.out.println("after shuffle ");
  18. for (int key : keys) {
  19. System.out.println("key : " + key + " value: " + mapPoints.get(key));
  20. }
Add Comment
Please, Sign In to add comment