SortedList

SortedList


Provides a means to maintain a list of sorted items based on an associated key.


Implements:

ICollection 
IDictionary 
IEnumerable 
IObject 
IVersionable 

Public:

Properties:

NameDescription
 Capacity (get) Gets the capacity of the SortedList object.  
 Capacity (let) Gets the capacity of the SortedList object.  
 Count (get) Gets the number of elements contained in a SortedList object.  
 IsFixedSize (get) Gets a value indicating whether a SortedList object has a fixed size.  
 IsReadOnly (get) Gets a value indicating whether a SortedList object is read-only.  
 Item (get) Gets the value associated with a specific key in a SortedList object.  
 Item (let) Sets the value associated with a specific key in a SortedList object.  
 Item (set) Sets the value associated with a specific key in a SortedList object.  
 Keys (get) Gets the keys in the SortedList object.  
 Values (get) Gets the values in the SortedList object.  

Methods:

NameDescription
 Add Adds an element with the specified key and value to a SortedList object..  
 Clear Removes all of the items from the SortedList object.  
 Clone Returns a cloned version of this instance.  
 Contains Determines whether a SortedList object contains a specific key.  
 ContainsKey Determines whether a SortedList object contains a specific key.  
 ContainsValue Determines whether a SortedList object contains a specific value.  
 CopyTo Copies SortedList elements to a one-dimensional array, starting at the specified index in the array.  
 Equals Returns a boolean indicating if the value and this object instance are the same instance.  
 GetByIndex Gets the value at the specified index of a SortedList object.  
 GetEnumerator Returns an enumerator that can be used to iterate through the key/value pairs.  
 GetHashCode Returns a pseudo-unique number identifying this instance.  
 GetKey Returns the key at the specified index in the list.  
 GetKeyList Gets the keys in a SortedList object.  
 GetValueList Gets the values in a SortedList object.  
 IndexOfKey Returns the zero-based index of the specified key in a SortedList object.  
 IndexOfValue Returns the zero-based index of the first occurrence of the specified value in a SortedList object.  
 Remove Removes the element with the specified key from a SortedList object.  
 RemoveAt Removes the element at the specified index of a SortedList object.  
 SetByIndex Replaces the value at a specific index in a SortedList object.  
 ToString Returns a string representation of this object instance.  
 TrimToSize Sets the capacity to the actual number of elements in a SortedList object.  

Remarks

The SortedList maintains sort order for every key/value pair added to the list. The list is expanded as needed with the addition of new items. If a key already exists in the list, an exception is thrown.

See Also

Project CorLib Overview

Class SortedList Overview

Constructors

IDictionary

ICollection

IEnumerable