As far as I'm aware of, the only Map implementation in the Java Collections API that orders its entries by insertion order is the LinkedHashMap, which maintians a linked list.
Why is there no something like ArrayMap that uses an array or ArrayList internally? Does the differences that separates ArrayList and LinkedList no longer matter in a Map? Or am I missing something that makes this data structure in general a bad idea? And if that is the case, is LinkedHashMap my only option for Map implementation within the Java standard library if I want insertion order?
ArrayListinternally guaranteee ordering by insertion order? Which is that that you want?ArrayListinternally? if so, why? Insertion order? If so, why notLinkedHashMap?Listis supposed to guarantee insertion order. I'm just curious if there areArrayListandLinkedList, why not in Map? Does the differences of the data structures no longer matter for a Map?