I want a Dictionary (HashTable, Map, ...) that has one key and several values.
I.e. I want something like
HashTable<Key, [value1, value2]>
How do I get this?
The easiest way I think:
Map<Key, List<Value>>
If you would rather just have a tuple (pair, 3, or ...) you can create a Pair class.
class Pair<E,F, ...> {
public E one;
public F two;
...
}
And then use a Map like so:
Map<Key, Pair<Value, Value>>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With