Java collections framework: Difference between revisions

Content deleted Content added
Map interfaces: Add subheadings
Add subsection
Line 189:
 
===Map interface implementations===
Maps are data structures that associate a key with an element. This lets the map be very flexible. If the key is the hash code of the element, the <code>Map</code> is essentially a <code>Set</code>. If it's just an increasing number, it becomes a list. <code>Map</code>s

Examples areof implemented{{java|Map}} byimplementations <code>include '''{{Javadoc|module=java.utilbase|package=java.util|class=HashMap</code>|monotype=y}}''', '''{{Javadoc|module=java.base|package=java.util|class=LinkedHashMap|monotype=y}}''' , and '''{{Javadoc|module=java.base|package=java.util|class=TreeMap|monotype=y}}'''.
 
====AbstractMap class====
 
{{java|AbstractMap }} is an example of a ''skeletal implementation''.{{sfn|Bloch|2018|loc=Chapter §4 Item 20: Prefer interfaces to abstract classes|pp=99-103}}
 
The direct subclasses of {{java|ConcurrentHashMap}} class include {{java|ConcurrentSkipListMap}}, {{java|EnumMap}}, {{java|HashMap}}, {{java|IdentityHashMap}}, {{java|TreeMap}} and {{java|WeakHashMap}}.
 
====HashMap====