BoostMultimap - wuyichen24/boost GitHub Wiki

BoostMultimap is similar to Guava Multimap which one key can map to multiple values. This is my implementation based on LinkedHashMap.

a -> [1, 2, 4]
b -> [3]
c -> [5]

Methods for BoostMultimap

get

Returns the collection of values for an explicitly provided key.

put

Stores a key-value pair in this BoostMultimap.

size

Return the size of this BoostMultimap.

isEmpty

Check this BoostmultiMap is empty or not.

containsKey

Check the existence of an provided key in the BoostMultimap.

containsValue

Check the existence of an provided value.

containsEntry

Check the existence of an provided key-value pair.

remove

Remove a provided key-value pair from this BoostMultimap.

removeAll

Remove a collection of a provided key from this BoostMultimap.

sortByKey

Sorts the key-value pairs in this BoostMultimap by key.

keySet

Returns a view collection of all distinct keys contained in this BoostMultimap.

entries

Get the list of all the entries in this BoostMultimap.