MultiMap

public class MultiMap
extends Object

java.lang.Object
   ↳ com.android.tradefed.util.MultiMap<K, V>


A ERROR(/Map) that supports multiple values per key.

Summary

Public constructors

MultiMap()
MultiMap(MultiMap<K, V> map)
MultiMap( map)

Public methods

void clear()

Clears the map.

boolean containsKey(K key)

Checks whether the map contains the specified key.

boolean containsValue(V value)

Checks whether the map contains the specified value.

entries()

Returns a collection of all key-value pairs in this MultiMap as Map.Entry instances.

boolean equals(Object obj)

get(K key)

Gets the list of values associated with each key.

getUniqueMap()

Construct a new map, that contains a unique String key for each value.

int hashCode()

boolean isEmpty()
keySet()

Returns a collection of all distinct keys contained in this multimap.

V put(K key, V value)

Adds the value to the list associated with a key.

void putAll( m)

Adds all entries in given ERROR(/Map) to this MultiMap.

remove(K key)

Removes all values associated with the specified key.

int size()

Returns the number of keys in the map

values()

Returns list of all values.

Public constructors

MultiMap

public MultiMap ()

MultiMap

public MultiMap (MultiMap<K, V> map)

Parameters
map MultiMap

MultiMap

public MultiMap ( map)

Parameters
map

Public methods

clear

public void clear ()

Clears the map.

containsKey

public boolean containsKey (K key)

Checks whether the map contains the specified key.

Parameters
key K

Returns
boolean

containsValue

public boolean containsValue (V value)

Checks whether the map contains the specified value.

Parameters
value V

Returns
boolean

entries

public  entries ()

Returns a collection of all key-value pairs in this MultiMap as Map.Entry instances.

Returns

equals

public boolean equals (Object obj)

Parameters
obj Object

Returns
boolean

get

public  get (K key)

Gets the list of values associated with each key.

Parameters
key K

Returns

getUniqueMap

public  getUniqueMap ()

Construct a new map, that contains a unique String key for each value. Current algorithm will construct unique key by appending a unique position number to key's toString() value

Returns
a ERROR(/Map)

hashCode

public int hashCode ()

Returns
int

isEmpty

public boolean isEmpty ()

Returns
boolean

keySet

public  keySet ()

Returns a collection of all distinct keys contained in this multimap.

Returns

put

public V put (K key, 
                V value)

Adds the value to the list associated with a key.

Parameters
key K

value V

Returns
V

putAll

public void putAll ( m)

Adds all entries in given ERROR(/Map) to this MultiMap.

Parameters
m

remove

public  remove (K key)

Removes all values associated with the specified key.

Parameters
key K

Returns

size

public int size ()

Returns the number of keys in the map

Returns
int

values

public  values ()

Returns list of all values.

Returns