23 using System.Diagnostics;
25 namespace Lucene.Net.Support
33 internal class GeneralKeyedCollection<TKey, TItem> : System.Collections.ObjectModel.KeyedCollection<TKey, TItem>
40 internal GeneralKeyedCollection(Converter<TItem, TKey> converter)
44 if (converter == null)
throw new ArgumentNullException(
"converter");
47 this.converter = converter;
56 private readonly Converter<TItem, TKey> converter;
64 protected override TKey GetKeyForItem(TItem item)
67 Debug.Assert(converter != null);
70 return converter(item);
78 public bool ContainsKey(TKey key)
81 if (Dictionary != null)
83 return Dictionary.ContainsKey(key);
91 public System.Collections.Generic.IList<TItem> Values()