Wintellect.PowerCollections Namespace
Algorithms Class
GhostDoc Pro Sample Help File

OrderedMultiDictionary<(Of <(<'TKey, TValue>)>)>..::..RangeTo Method

Returns a collection that can be used for enumerating some of the keys and values in the collection. Only items that are less than (and optionally, equal to) to are included. The items are enumerated in sorted order. Items equal to to can be included or excluded depending on the toInclusive parameter.

Namespace:  Wintellect.PowerCollections
Assembly:  PowerCollections (in PowerCollections.dll)

Syntax


Public Function RangeTo ( _
	to As TKey, _
	toInclusive As Boolean _
) As OrderedMultiDictionary<(Of <(<'TKey, TValue>)>)>..::..View
public:
OrderedMultiDictionary<(Of <(<'TKey, TValue>)>)>..::..View^ RangeTo(
	TKey to, 
	bool^ toInclusive
)

Parameters

to
Type: TKey
The upper bound of the range.
toInclusive
Type: Boolean
If true, the upper bound is inclusive--keys equal to the upper bound will be included in the range. If false, the upper bound is exclusive--keys equal to the upper bound will not be included in the range.

Return Value

An OrderedMultiDictionary.View of key-value pairs in the given range.

Remarks


The sorted order of the keys is determined by the comparison instance or delegate used to create the dictionary.

Typically, this property is used in conjunction with a foreach statement. For example:

C#
foreach(KeyValuePair<TKey, TValue> pair in dictionary.RangeFrom(from, false)) {
   // process pair
}

Calling RangeTo does not copy the data in the dictionary, and the operation takes constant time.