|
namespace HashTableDict |
|
{ |
|
using System.Collections; |
|
using System.Collections.Generic; |
|
|
|
public class Hashtable<TKey, TValue> : IDictionary<TKey, TValue> |
|
where TKey : class |
|
where TValue : class |
|
{ |
|
private readonly Hashtable _ht = new Hashtable(); |
|
|
|
// 实现以下接口。 |
|
|
|
public int Count |
|
{ |
|
get { throw new System.NotImplementedException(); } |
|
} |
|
|
|
public bool ContainsKey(TKey key) |
|
{ |
|
throw new System.NotImplementedException(); |
|
} |
|
|
|
public void Add(TKey key, TValue value) |
|
{ |
|
throw new System.NotImplementedException(); |
|
} |
|
|
|
public bool Remove(TKey key) |
|
{ |
|
throw new System.NotImplementedException(); |
|
} |
|
|
|
public bool TryGetValue(TKey key, out TValue value) |
|
{ |
|
throw new System.NotImplementedException(); |
|
} |
|
|
|
public TValue this[TKey key] |
|
{ |
|
get { throw new System.NotImplementedException(); } |
|
set { throw new System.NotImplementedException(); } |
|
} |
|
|
|
public void Clear() |
|
{ |
|
throw new System.NotImplementedException(); |
|
} |
|
|
|
/* 以下接口无需实现 */ |
|
|
|
public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator() |
|
{ |
|
throw new System.NotImplementedException(); |
|
} |
|
|
|
IEnumerator IEnumerable.GetEnumerator() |
|
{ |
|
return GetEnumerator(); |
|
} |
|
|
|
public void Add(KeyValuePair<TKey, TValue> item) |
|
{ |
|
throw new System.NotImplementedException(); |
|
} |
|
|
|
public bool Contains(KeyValuePair<TKey, TValue> item) |
|
{ |
|
throw new System.NotImplementedException(); |
|
} |
|
|
|
public void CopyTo(KeyValuePair<TKey, TValue>[] array, int arrayIndex) |
|
{ |
|
throw new System.NotImplementedException(); |
|
} |
|
|
|
public bool Remove(KeyValuePair<TKey, TValue> item) |
|
{ |
|
throw new System.NotImplementedException(); |
|
} |
|
|
|
public bool IsReadOnly |
|
{ |
|
get { throw new System.NotImplementedException(); } |
|
} |
|
|
|
public ICollection<TKey> Keys |
|
{ |
|
get { throw new System.NotImplementedException(); } |
|
} |
|
|
|
public ICollection<TValue> Values |
|
{ |
|
get { throw new System.NotImplementedException(); } |
|
} |
|
} |
|
} |