KGy SOFT

CacheTKey, TValueCapacity Property

KGy SOFT Core Libraries Help
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.

Namespace:  KGySoft.Collections
Assembly:  KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 5.0.0-rc.1
Syntax

public int Capacity { get; set; }

Property Value

Type: 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

Reference