ptolemy.util
Interface MultiMap

All Superinterfaces:
java.util.Map
All Known Implementing Classes:
MultiHashMap

public interface MultiMap
extends java.util.Map

A map that associates a key with multiple values. Similar to MultiSet, MultiMap is a generalization of a abstract data structure (Map). Like Map, MultiMap does not allow duplicate keys. It associates a collection of objects to each key. Putting a new object under a key adds to the associated collection. Likewise, removing a object removes from the collection. Several things are open to the implementation classes. First is the ordering of the collection of all contained values. Second, ordering within the collection is also open to the implementation class. Each collection may or may not contain duplicates. For example, a implementation class may use HashSets to represent the collections. This effectively eliminate all duplicates but gives no ordering guarantee. Although it is rare, but one can also imagine having a hybrid implementation where each collection provide different guarantees depending on the key that they map under.

Since:
Ptolemy II 8.0
Version:
$Id: MultiMap.java 57053 2010-01-28 02:15:43Z cxh $
Author:
Man-Kit Leung
Accepted Rating:
Red (mankit)
Proposed Rating:
Red (mankit)

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Method Summary
 java.lang.Object remove(java.lang.Object key, java.lang.Object object)
          Remove a specified value from the map.
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values
 

Method Detail

remove

java.lang.Object remove(java.lang.Object key,
                        java.lang.Object object)
Remove a specified value from the map.

Parameters:
key - The specified key.
object - The specified object to remove from the collection.
Returns:
The removed item, or null if the item does not exist.