
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
254
|
Chapter 4: Generics
throw new ArgumentException(
"Argument passed is of wrong type", "value");
}
}
#endregion // Private methods
#region Public Properties
public int Capacity
{
get
{
return this.keys.Length;
}
set
{
this.InternalSetCapacity(value, true);
}
}
public SortDirectionComparer<TKey> Comparer
{
get
{
return this._sortDirectionComparer;
}
}
public int Count
{
get
{
return this._size;
}
}
public TValue this[TKey key]
{
get
{
TValue local1;
int num1 = this.IndexOfKey(key);
if (num1 >= 0)
{
return this.values[num1];
}
else
{
//throw new KeyNotFoundException( );
local1 = default(TValue);
return local1;
}
}
Example 4-3. ReversibleSortedList class (continued)