aQute.lib.collections
Class MultiMap<K,V>

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<K,List<V>>
          extended by aQute.lib.collections.MultiMap<K,V>
All Implemented Interfaces:
Serializable, Cloneable, Map<K,List<V>>

public class MultiMap<K,V>
extends HashMap<K,List<V>>
implements Map<K,List<V>>

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
MultiMap()
           
MultiMap(Class<K> keyClass, Class<V> valueClass, boolean noduplicates)
           
MultiMap(Map<K,List<V>> other)
           
MultiMap(MultiMap<K,V> other)
           
 
Method Summary
 boolean add(K key, V value)
           
 boolean addAll(K key, Collection<? extends V> value)
           
 Iterator<V> all()
           
 List<V> allValues()
          Return a collection with all values
 Map<K,V> flatten()
           
 Iterator<V> iterate(K key)
           
 boolean remove(K key, V value)
           
 boolean removeAll(K key, Collection<V> value)
           
 MultiMap<V,K> transpose()
           
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Constructor Detail

MultiMap

public MultiMap()

MultiMap

public MultiMap(Class<K> keyClass,
                Class<V> valueClass,
                boolean noduplicates)

MultiMap

public MultiMap(Map<K,List<V>> other)

MultiMap

public MultiMap(MultiMap<K,V> other)
Method Detail

add

public boolean add(K key,
                   V value)

addAll

public boolean addAll(K key,
                      Collection<? extends V> value)

remove

public boolean remove(K key,
                      V value)

removeAll

public boolean removeAll(K key,
                         Collection<V> value)

iterate

public Iterator<V> iterate(K key)

all

public Iterator<V> all()

flatten

public Map<K,V> flatten()

transpose

public MultiMap<V,K> transpose()

allValues

public List<V> allValues()
Return a collection with all values

Returns:


Copyright © 2014 aQute SARL. All rights reserved.