Class BiMultiMap<K>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<K,java.lang.Object>
-
- com.google.maps.android.data.geojson.BiMultiMap<K>
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.util.Map<K,java.lang.Object>
public class BiMultiMap<K> extends java.util.HashMap<K,java.lang.Object>Extension of HashMap that provides two main features. Firstly it allows reverse lookup for a key given a value, by storing a second HashMap internally which maps values to keys. Secondly, it supports Collection values, in which case, each item in the collection is used as a key in the internal reverse HashMap. It's therefore up to the caller to ensure the overall set of values, and collection values, are unique.Used by GeoJsonRenderer to store GeoJsonFeature instances mapped to corresponding Marker, Polyline, and Polygon map objects. We want to look these up in reverse to provide access to GeoJsonFeature instances when map objects are clicked.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BiMultiMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()BiMultiMap<K>clone()KgetKey(java.lang.Object value)Reverse lookup of key by value.java.lang.Objectput(K key, java.lang.Object value)java.lang.Objectput(K key, java.util.Collection values)voidputAll(java.util.Map<? extends K,?> map)java.lang.Objectremove(java.lang.Object key)
-
-
-
Method Detail
-
putAll
public void putAll(java.util.Map<? extends K,?> map)
-
put
public java.lang.Object put(K key, java.lang.Object value)
-
put
public java.lang.Object put(K key, java.util.Collection values)
-
remove
public java.lang.Object remove(java.lang.Object key)
-
clear
public void clear()
-
clone
@NonNull public BiMultiMap<K> clone()
- Overrides:
clonein classjava.util.HashMap<K,java.lang.Object>
-
getKey
public K getKey(java.lang.Object value)
Reverse lookup of key by value.- Parameters:
value- Value to lookup- Returns:
- Key for the given value
-
-