TArrayList

TList<TElement> that stores its elements in a contiguous array.

Inheritance

LevelAncestorDescription
1TObjectUltimate ancestor in a class hierarchy
2TBaseObjectA base class for objects that can be used instead of TObject.
3TCollection<TElement>Abstract base class for collections that store elements of type TElement
4TList<TElement>A collection of elements that can be accessed by index.
5TArrayList

Source

Collection.List.Array_.pas (29)

Description

Because TArrayList<TElement> stores its elements in a contiguous array, lookup operations by index are very fast. This comes at the expense of the lower performance of insert and delete operations because those operations can force the array to be moved to another memory location to accommodate size changes. TArrayList<TElement> tries to minimize the amount relocations of the array by maintaining some slack in the array size: the array size is available as Capacity and is always >= Count. When it is known in advance that a large number of elements will be added to the list it is advisable to set an appropriate Capacity in advance in order to limit or avoid memory relocations.

Fields

ScopeVisibilityTypeNameDescription
InstanceprivateTComparator<TElement>FComparator
Instanceprivatearray of TElementFElements
InstanceprivateTInteger32FCount

Methods

ScopeVisibilityResultNameDescription
InstanceprivateRescaleCapacity()
InstanceprotectedTElementGetElements(Index: TInteger32)
InstanceprotectedSetElements(Index: TInteger32; Value: TElement)
InstanceprotectedTInteger32GetCount()
InstanceprotectedSetCount(Value: TInteger32)
InstanceprotectedTInteger32GetCapacity()
InstanceprotectedSetCapacity(Value: TInteger32)
InstanceprotectedTComparator<TElement>GetComparator()
InstanceprotectedSetComparator(Value: TComparator<TElement>)
InstancepublicDestroy()
InstancepublicTBooleanAdd(Element: TElement)
InstancepublicAddAt(Index: TInteger32; Element: TElement)
InstancepublicTElementExtractAt(Index: TInteger32)
InstancepublicExchangeAt(Index1: TInteger32; Index2: TInteger32)
InstancepublicClear()