# Class: com.pnfsoftware.jeb.util.collect.MultiMap

A multi\-map of key\-values, whose insertion order for the values of a given key is maintained. This class is [serialializable](Ser). Null key is allowed; null values are allowed. 

 Thread\-safety: none. 

 Note: this class does not implement the [Map](Map) interface, but attempts to follow its guidelines and contracts the best it can. One notable exception is that this class does not override hashCode/equals.

## Constructor: MultiMap

Description: Create a new multi\-map.

## Constructor: MultiMap
- parameter: `keyOrder`, type: `com.pnfsoftware.jeb.util.collect.CollectionOrder`

Description: Create a new multi\-map.
parameter: keyOrder: 

## Method: clear


## Method: containsKey
- parameter: `key`, type: `K`
- return type: `boolean`


## Method: containsValue
- parameter: `value`, type: `V`
- return type: `boolean`


## Method: createKey
- parameter: `key`, type: `K`
- return type: `boolean`

Description: Create an explicit entry for a given key. If no values mapped by the given key previously existed, the associated value will be an empty collecction.
parameter: key: 
return: true if the map did not already contain the key; false otherwise \(the key entry         existed before\)

## Method: get
- parameter: `key`, type: `K`
- parameter: `safe`, type: `boolean`
- return type: `java.util.List<V>`

Description: Retrieve the list of values associated with the provided key.
parameter: key: a key
parameter: safe: if true, an empty list of values is returned if the key does not exist
return: a list, possibly null or empty \(depending on the `safe` parameter}

## Method: get
- parameter: `key`, type: `K`
- return type: `java.util.List<V>`

Description: Retrieve the list of values associated with the provided key. Same as [get\(key, safe=false\)](#get(Object, boolean)).
parameter: key: a key
return: a list, possibly null if nothing was `put` for the provided key

## Method: getSafe
- parameter: `key`, type: `K`
- return type: `java.util.List<V>`

Description: Retrieve the list of values associated with the provided key. Same as [get\(key, safe=true\)](#get(Object, boolean)).
parameter: key: 
return: 

## Method: isEmpty
- return type: `boolean`


## Method: keySet
- return type: `java.util.Set<K>`

Description: Retrieve a read\-only view of the keys. 

 WARNING: This method does not respect the [Map#keySet()](Map#keySet()) contract: the set returned is read\-only.
return: read\-only view of the key set

## Method: keySize
- return type: `int`


## Method: put
- parameter: `key`, type: `K`
- parameter: `value`, type: `V`
- return type: `int`


## Method: putAll
- parameter: `m`, type: `java.util.Map<? extends K,java.util.List<? extends V>>`


## Method: putMulti
- parameter: `key`, type: `K`
- parameter: `values`, type: `java.util.Collection<? extends V>`

Description: Add multiple elements mapped by the same key. Note that if an empty collection is provided, the entry for the provided key will not be be explicitly created.
parameter: key: 
parameter: values: 

## Method: remove
- parameter: `key`, type: `K`
- return type: `java.util.List<V>`


## Method: removeAll
- parameter: `keys`, type: `java.util.Collection<K>`
- return type: `boolean`

Description: Remove all entries mapping to the collection of keys. 

 Similar semantics as [Set#removeAll(Collection)](Set#removeAll(Collection)).
parameter: keys: 
return: true if the multi\-map was modified

## Method: removeMulti
- parameter: `key`, type: `K`
- parameter: `values`, type: `java.util.Collection<? extends V>`
- return type: `int`


## Method: removeMulti
- parameter: `key`, type: `K`
- parameter: `values`, type: `java.util.Collection<? extends V>`
- parameter: `removeEmptyBucket`, type: `boolean`
- return type: `int`


## Method: removeValue
- parameter: `key`, type: `K`
- parameter: `value`, type: `V`
- return type: `V`


## Method: removeValue
- parameter: `key`, type: `K`
- parameter: `value`, type: `V`
- parameter: `removeEmptyBucket`, type: `boolean`
- return type: `V`


## Method: size
- return type: `int`

Description: Get the number of key\-value mappings \(per Map interface\). That is, the number of values.
return: 

## Method: toString
- return type: `java.lang.String`


## Method: values
- return type: `java.util.Collection<V>`


