Wintellect.PowerCollections Namespace
Algorithms Class
GhostDoc Pro Sample Help File

BigList<(Of <(<'T>)>)>..::..Range Method

Returns a view onto a sub-range of this list. Items are not copied; the returned IList<T> is simply a different view onto the same underlying items. Changes to this list are reflected in the view, and vice versa. Insertions and deletions in the view change the size of the view, but insertions and deletions in the underlying list do not.

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

Syntax


public IList<T> Range(
	int index,
	int count
)
Public Function Range ( _
	index As Integer, _
	count As Integer _
) As IList(Of T)
public:
IList<T>^ Range(
	int^ index, 
	int^ count
)

Parameters

index
Type: Int32
The starting index of the view.
count
Type: Int32
The number of items in the view.

Return Value

A list that is a view onto the given sub-list.

Exceptions


ExceptionCondition
ArgumentOutOfRangeExceptionindex or count is negative.
ArgumentOutOfRangeExceptionindex + count is greater than the size of this list.

Remarks


If a copy of the sub-range is desired, use the GetRange(Int32, Int32) method instead.

This method can be used to apply an algorithm to a portion of a list. For example:

C#
Algorithms.ReverseInPlace(list.Range(3, 6))
will reverse the 6 items beginning at index 3.