Wintellect.PowerCollections Namespace
Algorithms Class
GhostDoc Pro Sample Help File

OrderedBag<(Of <(<'T>)>)>..::..RangeFrom Method

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

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

Syntax


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

Parameters

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

Return Value

An OrderedBag.View of items in the given range.

Remarks


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

C#
foreach(T item in bag.RangeFrom(from, true)) {
   // process item
}

If an item is added to or deleted from the bag while the View is being enumerated, then the enumeration will end with an InvalidOperationException.

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