What do you call a collection in which each item may be looked up by one of multiple keys? A partial, simplified definition in C# might be:
class MyDataStructure<TKey1, TKey2, TValue> {
private List<TValue> _values;
//map keys to indices
private Dictionary<TKey1, int> _keys1;
private Dictionary<TKey2, int> _keys2;
public TValue GetByKey1(TKey1 key) ...
public TValue GetByKey2(TKey2 key) ...
}
There's MultiKeyMap in Java, but that seems to lookup items based on a combination of keys, not by each key individually. Does what I've described have a well-established name?
EDIT
If there's not an established name, feel free to offer a new one. Or state your preference for one of these:
- ChoiceKeyDictionary
- AlternateKeyDictionary
- DualKeyDictionary