Wintellect.PowerCollections Namespace
Algorithms Class
GhostDoc Pro Sample Help File

OrderedDictionary<(Of <(<'TKey, TValue>)>)>..::..RangeFrom Method

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

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

Syntax


public OrderedDictionary<(Of <(<'TKey, TValue>)>)>..::..View RangeFrom(
	TKey from,
	bool fromInclusive
)
Public Function RangeFrom ( _
	from As TKey, _
	fromInclusive As Boolean _
) As OrderedDictionary<(Of <(<'TKey, TValue>)>)>..::..View
public:
OrderedDictionary<(Of <(<'TKey, TValue>)>)>..::..View^ RangeFrom(
	TKey from, 
	bool^ fromInclusive
)

Parameters

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

Return Value

An OrderedDictionary.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, true)) {
   // process pair
}

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