CircularListTAsReadOnly Method

Returns a read-only IListT wrapper for the current collection.

Definition

Namespace: KGySoft.Collections
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
public ReadOnlyCollection<T> AsReadOnly()

Return Value

ReadOnlyCollectionT
A ReadOnlyCollectionT that acts as a read-only wrapper around the current CircularListT.

Remarks

To prevent any modifications to CircularListT, expose CircularListT only through this wrapper. A ReadOnlyCollectionT does not expose methods that modify the collection. However, if changes are made to the underlying CircularListT, the read-only collection reflects those changes.

This method is an O(1) operation.

See Also