Multimap

Multimap

A multimap (sometimes also multihash) is a generalization of a map or associative array abstract data type in which more than one value may be associated with and returned for a given key. Both map and multimap are particular cases of containers (see for example C++ Standard Template Library containers). Often the multimap is implemented as a map with lists or sets as the map values.

Contents

Examples

  • In a student enrollment system, where students may be enrolled in multiple classes simultaneously, there might be an association for each enrollment of a student in a course, where the key is the student ID and the value is the course ID. If a student is enrolled in three courses, there will be three associations containing the same key.
  • The index of a book may report any number of references for a given index term, and thus may be coded as a multimap from index terms to any number of reference locations.
  • Querystrings may have multiple values associated with a single field. This is commonly generated when a web form allows multiple check boxes or selections to be chosen in response to a single form element.

Language support

C++'s Standard Template Library provides the multimap container for the sorted multimap using a self-balancing binary search tree,[1] and SGI's STL extension provides the hash_multimap container, which implements a multimap using a hash table.[2]

Apache Commons Collections provides a MultiMap interface for Java.[3] It also provides a MultiValueMap implementing class that makes a MultiMap out of a Map object and a type of Collection.[4]

Google Collections also provides an interface Multimap and implementations.[5]

Scala language's API also provides Multimap and implementations[6]

See also

References

  1. ^ "multimap<Key, Data, Compare, Alloc>". Standard Template Library Programmer's Guide. Silicon Graphics International. http://www.sgi.com/tech/stl/Multimap.html. 
  2. ^ "hash_multiset<Key, HashFcn, EqualKey, Alloc>". Standard Template Library Programmer's Guide. Silicon Graphics International. http://www.sgi.com/tech/stl/hash_multiset.html. 
  3. ^ "Interface MultiMap". Commons Collections 3.2.1 API, Apache Commons. http://commons.apache.org/collections/api-release/org/apache/commons/collections/MultiMap.html. 
  4. ^ "Class MultiValueMap". Commons Collections 3.2.1 API, Apache Commons. http://commons.apache.org/collections/api-release/org/apache/commons/collections/map/MultiValueMap.html. 
  5. ^ "Interface Multimap<K,V>". Google Collections Library 1.0. http://google-collections.googlecode.com/svn/trunk/javadoc/com/google/common/collect/Multimap.html. 
  6. ^ "Scala.collection.mutable.MultiMap". Scala stable API. http://www.scala-lang.org/api/current/scala/collection/mutable/MultiMap.html. 

Wikimedia Foundation. 2010.

Игры ⚽ Нужно сделать НИР?

Look at other dictionaries:

  • Multimap — es uno de los principales servicios gratuitos de cartografía en web junto a Googlemaps, ofreciendo localizaciones, rutas y vistas fotográficas satelitales. La empresa, con sede en el Reino Unido, fue comprada por Microsoft por unos 25 millones de …   Wikipedia Español

  • Multimap.com — was a United Kingdom based provider of mapping and location based services. It was acquired by Microsoft in 2007 and merged into Bing Maps in 2010.[1] …   Wikipedia

  • Multimap (data structure) — A multimap is a generalization of a map or associative array abstract data type in which more than one value may be associated with and returned for a given key. Both map and multimap are particular cases of containers (see for example C++… …   Wikipedia

  • multimap — noun A data structure that maps a single key to multiple values …   Wiktionary

  • King Street (Roman road) — King Street is the name of a modern road on the line of a Roman road (getamap|TF106117|map. It runs on a straight course in eastern England, between the City of Peterborough and South Kesteven in Lincolnshire. This English name has long been… …   Wikipedia

  • Opérateur monotone — En mathématiques, un opérateur monotone est une multifonction définie entre espaces préhilbertiens, qui possède une propriété de monotonie que nous précisons dans la définition ci dessous. Lorsque cet opérateur est une «simple» fonction réelle d… …   Wikipédia en Français

  • Straiton, Loanhead — Straiton is a part of Loanhead, Midlothian, Scotland. http://maps.google.co.uk/maps?f=q hl=en geocode= q=straiton+loanhead sll=55.884363, 3.166902 sspn=0.015092,0.033002 ie=UTF8 z=15 iwloc=addr] Straiton is home to a retail park owned by the Peel …   Wikipedia

  • Battle of Culloden — Infobox Military Conflict conflict=Battle of Culloden partof=the Jacobite Rising of 1745–46 caption= date=16 April 1746 place=Culloden, Scotland result=Decisive Hanoverian Victory combatant1=flagicon|UK|1606 British Army combatant2=Jacobites,… …   Wikipedia

  • Ashford, Kent — infobox UK place country = England official name= Ashford latitude= 51.1465 longitude= 0.8676 population = 58,936 [ [http://www.statistics.gov.uk/StatBase/ssdataset.asp?vlnk=8271 Pos=2 ColRank=1 Rank=224 Office for National Statistics Key… …   Wikipedia

  • 159 Supply Regiment RLC(V) — 159 Supply Regiment, The Royal Logistic Corps (Volunteers) is a regiment of the Territorial Army, the volunteer reserve force of the British Army. It has its Regimental Headquarters at Carters Green, West Bromwich, in the West Midlands… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”