Timeline for Get LinkedList of entries from LinkedHashMap with values() method
Current License: CC BY-SA 4.0
25 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 10, 2019 at 7:13 | audit | Triage | |||
| May 10, 2019 at 7:13 | |||||
| May 9, 2019 at 7:12 | audit | Triage | |||
| May 9, 2019 at 7:24 | |||||
| May 5, 2019 at 17:52 | audit | Triage | |||
| May 5, 2019 at 18:27 | |||||
| May 4, 2019 at 19:06 | audit | Triage | |||
| May 4, 2019 at 19:07 | |||||
| May 1, 2019 at 14:27 | audit | Triage | |||
| May 1, 2019 at 15:19 | |||||
| Apr 29, 2019 at 1:22 | audit | Triage | |||
| Apr 29, 2019 at 2:35 | |||||
| Apr 26, 2019 at 9:26 | audit | Triage | |||
| Apr 26, 2019 at 9:26 | |||||
| Apr 25, 2019 at 9:27 | audit | Triage | |||
| Apr 25, 2019 at 9:30 | |||||
| Apr 10, 2019 at 13:10 | vote | accept | Rostislav V | ||
| Apr 10, 2019 at 13:01 | history | edited | Nikolas | edited tags | |
| Apr 10, 2019 at 12:37 | answer | added | Nikolas | timeline score: 6 | |
| Apr 10, 2019 at 12:36 | answer | added | Andrew | timeline score: 1 | |
| Apr 10, 2019 at 12:32 | comment | added | Laksitha Ranasingha | The Iteration order also depends on the constructor you use. Because you could specify if you need accessed order (like an LRU cache) or insertion order. | |
| Apr 10, 2019 at 12:23 | comment | added | Marco13 | @Zabuza Sure, we know that it is like that, and we know that thousands of people do rely on that, and that it therefore always will be like that (otherwise, many implementations would break). Nevertheless, I was a bit surprised to not find it explicitly stated in the JavaDoc. | |
| Apr 10, 2019 at 12:17 | comment | added | Zabuzard | If that is not enough, then it is debatable and, if absolute necessary, should technically not be relied on. However, even if the Java-devs don't see this as documented promised feature, I highly doubt they would ever change that, as it would break an extreme amount of code. | |
| Apr 10, 2019 at 12:15 | comment | added | Zabuzard | @Marco13 I agree that there is no absolute clear statement about that. For me, it is implied by them saying that all returned Collections are views of the map. The map guarantees that iteration order, so the Collections must as well, except stated otherwise, as they are views and as such, must behave the same. | |
| Apr 10, 2019 at 12:11 | comment | added | Pshemo | "Get LinkedList of entries .. with values() method" can't be done since values() doesn't return entries (as key-value pairs, but only list of values). Your question looks more like "Does LinkedHashMap guarantee same order for entrySet() and values()?" (but I am not sure if that is what you really wanted to ask because I still don't know what is the purpose of LinkedList here) | |
| Apr 10, 2019 at 12:09 | history | edited | Laksitha Ranasingha | CC BY-SA 4.0 | added 1 character in body |
| Apr 10, 2019 at 12:08 | comment | added | Rostislav V | done, I hope the title is better now @Pshemo | |
| Apr 10, 2019 at 12:08 | comment | added | Marco13 | @Zabuza It's surprisingly hard to find a definite statement about that in the JavaDoc. At least, I did not find something like: "The iteration order of the collection returned by the values() method is guaranteed to be the same as the insertion order". This certainly is the case, but it is not mentioned so explicitly... | |
| Apr 10, 2019 at 12:07 | history | edited | Rostislav V | CC BY-SA 4.0 | edited title |
| Apr 10, 2019 at 12:04 | comment | added | Zabuzard | keySet(), values() and entrySet() will all three give you internally backed views without additional cost. All of them are just views to the actual internal representation, they all represent the same. In particular, no copies or anything are created, it comes with no real cost. This is documented in Javadoc, please check the documentation first. | |
| Apr 10, 2019 at 12:03 | comment | added | Pshemo | Your question title doesn't really match question which you are asking at the end. Can you edit your title to actually be related to answers which you expect to get? | |
| Apr 10, 2019 at 12:01 | answer | added | Pateman | timeline score: 0 | |
| Apr 10, 2019 at 11:57 | history | asked | Rostislav V | CC BY-SA 4.0 |