CircularListTGetRange Method

Creates a shallow copy of a range of elements in the source CircularListT.

Definition

Namespace: KGySoft.Collections
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
public CircularList<T> GetRange(
	int index,
	int count
)

Parameters

index  Int32
The zero-based index at which the range starts.
count  Int32
The number of elements in the range.

Return Value

CircularListT
A shallow copy of a range of elements in the source CircularListT.

Remarks

A shallow copy of a collection of reference types, or a subset of that collection, contains only the references to the elements of the collection. The objects themselves are not copied. The references in the new list point to the same objects as the references in the original list.

A shallow copy of a collection of value types, or a subset of that collection, contains the elements of the collection. However, if the elements of the collection contain references to other objects, those objects are not copied. The references in the elements of the new collection point to the same objects as the references in the elements of the original collection.

In contrast, a deep copy of a collection copies the elements and everything directly or indirectly referenced by the elements.

This method is an O(n) operation, where n is count.

See Also