SortedList

SortedList


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


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 VBCorLib Overview | Constructors | IDictionary | ICollection | IEnumerable

Implements:

ICollection 
IDictionary 
IEnumerable 
IObject 

Public:

Properties:

NameDescription
 Capacity (get)Returns the size of the underlying array. 
 Capacity (let)Sets the size of the underlying array. 
 Count (get)Returns the number of items in the list. 
 IsFixedSize (get)Returns if the list can change in size or not. 
 IsReadOnly (get)Returns if the list can be modified in any way. 
 Item (get)Returns the value associated with the given key. 
 Item (let)Sets a value to a key. 
 Item (set)Sets a value to a key. 
 Keys (get)Returns the keys in the sorted list. 
 Values (get)Returns a list of the values in the list. 

Methods:

NameDescription
 AddAdds a key/value pair to the list. 
 ClearRemoves all of the items from the list. 
 CloneReturns a cloned version of this instance. 
 ContainsSearches the list to determine if the key is contained in the list. 
 ContainsKeySearches the list to determine if the key is contained in the list. 
 ContainsValueSearches the list to determine if the value is contained in the list. 
 CopyToCreates a DictionaryEntry for each Key/Value pair and places it in the array. 
 EqualsReturns a boolean indicating if the value and this object instance are the same instance. 
 GetByIndexRetrieves a value in the list by an index. 
 GetEnumeratorReturns an enumerator that can be used to iterate through the key/value pairs. 
 GetHashCodeReturns a pseudo-unique number identifying this instance. 
 GetKeyReturns the key at the specified index in the list. 
 GetKeyListReturns a ReadOnly IList object that is used to access the keys in the list. 
 GetValueListReturns a ReadOnly IList object that is used to access the values in the list. 
 IndexOfKeySearches for a key in the list and returns the index it was found. 
 IndexOfValueSearches for a value in the list and returns the index it was found. 
 RemoveRemoves a key/value pair based on the key. 
 RemoveAtRemoves a key/value pair at a specific index in the list. 
 SetByIndexSets the value at a specific index in the list. 
 ToStringReturns a string representation of this object instance. 
 TrimToSizeSets the capacity to the number of items in the list.