Questions tagged [multimap]

A container similar to a map but allowing duplicate keys

Use this tag for questions about associative arrays with non-unique keys, such as the std::multimap container in the C++ standard library, or scala.collection.mutable.MultiMap in Scala.

See the Wikipedia article for more information.

773 questions
-2
votes
3 answers

Overloading output (<<) operator for a class with private enum member

I'm having a hard time trying to overload my << output operator for this class. The class has private members - enum class and string. The code I made compiles and runs, but the << operator is overloaded only for the enum class. From what I…
hopittyhop
  • 119
  • 12
-2
votes
3 answers

How to sort multimap in java with similar values

Hello everyone I am a beginner with Java. I have created a multimap with below data and I want to sort the multimap in a specific way. Key Values Basket1 apple_green …
Jayesh
  • 11
  • 1
-3
votes
1 answer

Multimap with unique values

I'm trying to store a list of objects in a Hazelcast MultiMap. Each object has a name and other attributes. That name should be unique for the given key in this Map. How can I configure MultiMap that it doesn't store twice or more the same name? I'm…
Markus
  • 1
-3
votes
1 answer

Are multi-dimensional multi maps possible?

All the examples of multimap, yet to find a multi-dimensional example... System: Visual Studio 2019, C++. Winapi with no extra libraries Expected result: stores a multi-dimensional array of key/value pairs. Able to pull up a key pair by specifying…
kbaud
  • 25
  • 7
-4
votes
2 answers

In java how to get all values for a given key in multimap?

In java,want to get the values for a given key in multimap of guava and apache commons. say MultiMap dbOutput and now want to get all the values for the key "key" which is present in dbOutput.
shaheer01
  • 111
  • 2
  • 11
-4
votes
1 answer

unable to print value from multimap

i am using a multimap to store some data using openframeworks. i am able to create the multimap, but when i try to print the data within it, i am only able to print the memory address and not get the value. reference (section "storing objects in a…
-5
votes
2 answers

Count occurrences by object id in std::multimap

I'm trying to find the occurrences of an object in a std::multimap Here is my object Point: class Point { public: Point(string id, float x, float y, float z); string m_id; float m_x; float m_y; float m_z; //I want to count…
kyu
  • 111
  • 1
  • 10
-6
votes
1 answer

How to access particular elements in a multi-map C++

I have implemented a multi-map, but I​ was wondering how do I access the first 5 elements of a multimap? I tried using a for-loop, but that didn't work out. Any suggestions?
1 2 3
51
52