System.Generics.Collections.TDictionary.Capacity

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property Capacity: Integer read GetCapacity write SetCapacity;

C++

__property int Capacity = {read=GetCapacity, write=SetCapacity, nodefault};

Properties

Type Visibility Source Unit Parent
property public
System.Generics.Collections.pas
System.Generics.Collections.hpp
System.Generics.Collections TDictionary

Description

Dictionary's capacity.

Capacity gets or sets the dictionary's capacity, that is, the maximum size of the dictionary without resizing.

When it is set, the capacity will be set to a value internally, which is the power of two, and 75% of it is greater than or equal to a new value. The capacity cannot be set to less than Count, the actual number of items in the dictionary.

The TrimExcess method reduces the dictionary's capacity to its current number of elements, Count.

See Also

Code Examples