public class CMultyDictionary<TKey, TValue>

{

ย  ย  Dictionary<TKey, List<TValue>> dictionary;


ย  ย  public CMultyDictionary()

ย  ย  {

ย  ย  ย  ย  dictionary = new Dictionary<TKey, List<TValue>>();

ย  ย  }

ย  ย  public List<TValue> this[TKey key]

ย  ย  {

ย  ย  ย  ย  get

ย  ย  ย  ย  {

ย  ย  ย  ย  ย  ย  List<TValue> list;

ย  ย  ย  ย  ย  ย  if (dictionary.TryGetValue(key, out list))

ย  ย  ย  ย  ย  ย  {

ย  ย  ย  ย  ย  ย  ย  ย  return list;

ย  ย  ย  ย  ย  ย  }

ย  ย  ย  ย  ย  ย  else

ย  ย  ย  ย  ย  ย  {

ย  ย  ย  ย  ย  ย  ย  ย  return new List<TValue>();

ย  ย  ย  ย  ย  ย  }

ย  ย  ย  ย  }

ย  ย  }

}


์—ฌ๊ธฐ ๋ถ€๋ถ„์ธ ์ดํ•ด๊ฐ€ ์•ˆ๋จ ์ด๊ฒƒ๋„ thisย ํ”„๋กœํผํ‹ฐ์ธ๊ฐ€ ์•„๋‹Œ๊ฐ€๋„ ์ž˜ ๋ชจ๋ฅด๊ฒ ์Œ

this๋Š” class๋ฅผ ๊ฐ€๋ฆฌํ‚ค๋Š” ๊ฑฐ ์•„๋‹Œ๊ฐ€?

๋ญ˜๋กœ ๊ฒ€์ƒ‰ํ•ด๋ณด๋ฉด ์ข€ ์ƒ์„ธํ•˜๊ฒŒ ๋‚˜์˜ฌ๊นŒ? ์•„๋‹˜ ์ข€ ์•Œ๋ ค์ค„์‚ฌ๋žŒ