OrderedSetTRangeTo Method |
Returns a View collection that can be used for enumerating a range of the items in the set..
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: X3Platform.CollectionsAssembly: X3Platform.Support (in X3Platform.Support.dll) Version: 1.0.0.0 (2.0.0.0)
Syntaxpublic OrderedSetTView RangeTo(
T to,
bool toInclusive
)
public:
OrderedSetTView^ RangeTo(
T to,
bool toInclusive
)
Parameters
- to
- Type: T
The upper bound of the range. - toInclusive
- Type: SystemBoolean
If true, the upper bound is inclusive--items equal to the upper bound will
be included in the range. If false, the upper bound is exclusive--items equal to the upper bound will not
be included in the range.
Return Value
Type:
OrderedSetTViewAn OrderedSet.View of items in the given range.
RemarksTypically, this method is used in conjunction with a foreach statement. For example:
foreach(T item in set.RangeTo(to, false)) {
}
If an item is added to or deleted from the set while the View is being enumerated, then
the enumeration will end with an InvalidOperationException.
Calling RangeTo does not copy the data in the tree, and the operation takes constant time.
See Also