Simple collection for single key multiple data?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jon Slaughter

    #1

    Simple collection for single key multiple data?

    Is there a collection that lets you use a "multimap" like feature.

    something like

    MultiHash.Add(S ome_Key, Data1);
    MultiHash.Add(S ome_Key, Data2);
    ....


    Obviously I could handle this with an ArrayList in a HashTable but for my
    purposes it would be much easier if I had the above functionality(p robably
    would be to hard to add it or extend the hashtable if thats possible but
    wondering if theres something already built in.

    Thanks,
    Jon


  • Cor Ligthert [MVP]

    #2
    Re: Simple collection for single key multiple data?

    Jon,

    DataTable by some seen as something very strange but just a class which with
    its DataView(defaul tview property) is implementing the ILIST and the
    ICollection.

    Cor

    "Jon Slaughter" <Jon_Slaughter@ Hotmail.comschr eef in bericht
    news:qSR7h.2687 9$TV3.4847@news svr21.news.prod igy.com...
    Is there a collection that lets you use a "multimap" like feature.
    >
    something like
    >
    MultiHash.Add(S ome_Key, Data1);
    MultiHash.Add(S ome_Key, Data2);
    ...
    >
    >
    Obviously I could handle this with an ArrayList in a HashTable but for my
    purposes it would be much easier if I had the above functionality(p robably
    would be to hard to add it or extend the hashtable if thats possible but
    wondering if theres something already built in.
    >
    Thanks,
    Jon
    >
    >

    Comment

    • Peter Sestoft

      #3
      Re: Simple collection for single key multiple data?

      "Jon Slaughter" <Jon_Slaughter@ Hotmail.comwrit es:
      Is there a collection that lets you use a "multimap" like feature.
      >
      something like
      >
      MultiHash.Add(S ome_Key, Data1);
      MultiHash.Add(S ome_Key, Data2);
      ...
      >
      Obviously I could handle this with an ArrayList in a HashTable but for my
      purposes it would be much easier if I had the above functionality(p robably
      would be to hard to add it or extend the hashtable if thats possible but
      wondering if theres something already built in.
      See the MultiDictionary example in the C5 collection library


      Peter

      Comment

      Working...