org.semanticdesktop.aperture.util
Class ListMap<K,V>

java.lang.Object
  extended by org.semanticdesktop.aperture.util.ListMap<K,V>

public class ListMap<K,V>
extends Object

A Map like structure where each key maps to a list of values. I couldn't get the generics to work the way I wanted, so it doesn't inherit anything. TODO: move this to a utils project.

Author:
grimnes, sauermann

Constructor Summary
ListMap()
           
 
Method Summary
 boolean containsKey(K key)
           
 Set<Map.Entry<K,V>> entrySet()
          Returns a Set copy of the mappings contained in this map.
 List<V> get(K key)
          Get all values registered for key K.
 V put(K key, V value)
           
 void remove(K key)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ListMap

public ListMap()
Method Detail

put

public V put(K key,
             V value)

get

public List<V> get(K key)
Get all values registered for key K.

Parameters:
key - the key
Returns:
null or a list

containsKey

public boolean containsKey(K key)

toString

public String toString()
Overrides:
toString in class Object

remove

public void remove(K key)

entrySet

public Set<Map.Entry<K,V>> entrySet()
Returns a Set copy of the mappings contained in this map.

Returns:
a copy of the listmap as set of entries


Copyright © 2010 Aperture Development Team. All Rights Reserved.