Hi all, I’m working on my first project where I need to convert from from pair of ints (midinote,channel) to an arbitrary set of integer (period,generator) coordinates. (The mapping is read in from a file).
My (admittedly limited) experience with hashmaps in Java led me to believe that the JUCE HashMaps would be perfect for this case, since they store keys and corresponding values. So I made a bag class for the pairs of ints, created a HashMap of type <bag,bag> (both input and output are just a pair of ints), and then realized I don’t see a function for actually returning the corresponding value for a key that’s already been added to the map.
https://docs.juce.com/master/classHashMap.html
Functions provided are things like finding out whether the hashmap Contains() a key, or containsValue(), and doing things like set() another mapping, remove() items with a given key, or removeValue() to remove all keys with a given value (so obviously the object itself still knows the association)… It does provide an iterator for the values, but even then, it seems like I still wouldn’t be able to associate them to the keys.
Am I able to use this class for that? (Storing a mapping, and then being able to actually reproduce the stored value, given a key?) Have I… missed something embarrassingly obvious? xD Is there a different data structure I should be looking at?
Thanks very much for any help!