Nikhil J. Nanivadekar @NikhilNanivade eclipse.org/collections
https://github.com/nikhilnanivadekar/DIYCollections
Do It Yourself: Collections
- What are collections:
- List: ordered collection, which allows duplicates
- Set: hashed collection, which retains only unique elements
- Map: mapping of key to value
- We want to create a new data structure:
- List, Set, Map
- What is a multimap?
Map<Key, Collection>
Collection of multiple Key, Value Pairs
- What should happen if the value collection is empty or null?
- What should happen if the value collection has duplicates?
The Key is not stored if the value collection is empty
It depends on the backing Collection
IN the last 40 mins we created 3 wrappers on the Map:
- Bag
- ListMultimap
- SetMultimap