CacheTKey, TValueCapacity Property

Gets or sets the capacity of the cache. If new value is smaller than elements count (value of the Count property), then old or least used elements (depending on Behavior) will be removed from CacheTKey, TValue.
Default value: 128, if the CacheTKey, TValue was initialized without specifying a capacity; otherwise, as it was initialized.

Definition

Namespace: KGySoft.Collections
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 9.0.0
C#
public int Capacity { get; set; }

Property Value

Int32

Implements

ICacheCapacity

Remarks

If new value is smaller than elements count, then cost of setting this property is O(n), where n is the difference of Count before setting the property and the new capacity to set.

If new value is larger than elements count, and EnsureCapacity returns , then cost of setting this property is O(n), where n is the new capacity.

Otherwise, the cost of setting this property is O(1).

See Also