{"action":"created","issue":{"url":"https://api.github.com/repos/emirpasic/gods/issues/39","repository_url":"https://api.github.com/repos/emirpasic/gods","labels_url":"https://api.github.com/repos/emirpasic/gods/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/emirpasic/gods/issues/39/comments","events_url":"https://api.github.com/repos/emirpasic/gods/issues/39/events","html_url":"https://github.com/emirpasic/gods/issues/39","id":177072683,"number":39,"title":"Access value in key comparator","user":{"login":"F21","id":2263040,"avatar_url":"https://avatars.githubusercontent.com/u/2263040?v=3","gravatar_id":"","url":"https://api.github.com/users/F21","html_url":"https://github.com/F21","followers_url":"https://api.github.com/users/F21/followers","following_url":"https://api.github.com/users/F21/following{/other_user}","gists_url":"https://api.github.com/users/F21/gists{/gist_id}","starred_url":"https://api.github.com/users/F21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/F21/subscriptions","organizations_url":"https://api.github.com/users/F21/orgs","repos_url":"https://api.github.com/users/F21/repos","events_url":"https://api.github.com/users/F21/events{/privacy}","received_events_url":"https://api.github.com/users/F21/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/emirpasic/gods/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-09-15T02:28:20Z","updated_at":"2016-09-15T05:18:25Z","closed_at":null,"body":"I want to implement a structure base on `TreeMap` where I have IP addresses as the key and a `TreeSet` as the value. I want to be able to sort the `TreeMap` using the `size()` of the `TreeSet`. This is currently impossible because the comparator can only access either the keys or values.\r\n\r\nFor example:\r\n\r\n```golang\r\nm := treemap.NewWith(myComparator)\r\n\r\ns1 := treeset.NewWithIntComparator()\r\ns1.Add(2, 2, 3, 4, 5) \r\n\r\ns2 := treeset.NewWithIntComparator()\r\ns2.Add(7, 8, 9) \r\n\r\nm.Put(\"server1\", s1)\r\nm.Put(\"server2\", s2)\r\n```\r\nUnfortunately, the `myComparator` can only access the keys:\r\n```golang\r\nfunc myComparator(a, b interface{}) int {\r\n\t// a and b are the keys\r\n}\r\n```\r\n\r\nWhat do you think about adding access to the values for key comparators used by maps?"},"comment":{"url":"https://api.github.com/repos/emirpasic/gods/issues/comments/247237130","html_url":"https://github.com/emirpasic/gods/issues/39#issuecomment-247237130","issue_url":"https://api.github.com/repos/emirpasic/gods/issues/39","id":247237130,"user":{"login":"F21","id":2263040,"avatar_url":"https://avatars.githubusercontent.com/u/2263040?v=3","gravatar_id":"","url":"https://api.github.com/users/F21","html_url":"https://github.com/F21","followers_url":"https://api.github.com/users/F21/followers","following_url":"https://api.github.com/users/F21/following{/other_user}","gists_url":"https://api.github.com/users/F21/gists{/gist_id}","starred_url":"https://api.github.com/users/F21/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/F21/subscriptions","organizations_url":"https://api.github.com/users/F21/orgs","repos_url":"https://api.github.com/users/F21/repos","events_url":"https://api.github.com/users/F21/events{/privacy}","received_events_url":"https://api.github.com/users/F21/received_events","type":"User","site_admin":false},"created_at":"2016-09-15T05:18:25Z","updated_at":"2016-09-15T05:18:25Z","body":"If I change the last 3 times of the code in my comment, it seems to lose entries in the map.\r\n\r\nCode:\r\n```golang\r\ns4.Add(6, 7, 8, 9, 10, 11)\r\nfmt.Println(m.GetKey(uint32(634199694)))\r\nfmt.Println(m)\r\n```\r\n\r\nResult:\r\n```\r\nTreeBidiMap\r\nmap[TreeSet\r\n1:634199694 TreeSet\r\n1, 2, 6, 7, 8, 9, 10, 11:634199695]\r\n```"}}
{"actor":{"display_login":"F21"}}