newLinkedHashMap( ( map | list | maplet )... )

Returns a new modifiable map, initialized with the specified items.

The map is implemented on top of a hash table and doubly linked list, which has a couple of trade offs. There order of iteration over the key-value pairs in the map, will match the order they where inserted. Modifying the value associated with a key should not affect this ordering. Adding, retrieving and modifying key-value pairs is a constant time operation, i.e. regardless of the size of the map these operations will take a constant time, but slightly more that a HashMap. Iterating over all the key-value pairs in the map is proportional to the number of key-value pairs defined, so should be faster than a HashMap. Finally, when adding lots of key-value pairs, the map may need to increase it's capacity resulting in a rehashing operation.

The map is initialized with the items you supply as arguments. This function deals with arguments in exactly the same way as the newMap function, so that information isn't repeated here.

Notes

If you know that you will not iterate over the key-value pairs in the map that often, consider using newLinkedHashMap instead.

If you know that you will add or modify key-value pairs in the map often and are happy with iterating over the key-value pairs in the natural ascending sort order of the keys, consider using newTreeMap instead.

If you want a map where the key-value pairs are automatically removed when the key is no longer in use, consider using newWeakHashMap instead.