Sign in Join
FPDoc Onlineexperiment

TObjectArray class

In unit ObjectLists

Implements an array of items with their associated objects.

Declaration

pascal
TObjectArray<TItem,TObj> = class

Description

TObjectArray is a generic type used to implement an array of items and their associated objects. TObjectArray allows the association to be defined using the TItem and TObj class types. Internally, it uses a list of records with pointers to the Items and Objects stored in the class. Properties and methods are provided to maintain and access the entries in the class instance, and the allocated storage for the array type.

See also

Properties

CapacitypublicSpecifies the number of associations that can be stored in the List.
CountpublicNumber of item/object associations currently stored in the List.
ItemspublicProvides indexed access to the TItem class instances stored in the List.
ObjectspublicProvides indexed access to the TObj class instances stored in the List.
ListpublicProvides access to the list which implements the storage for the item/object associations in the class instance.

Methods

GetprotectedGets the value for the Items property.
PutprotectedSets the value for the Items property.
GetObjectprotectedGets the value for the Objects property.
PutObjectprotectedSets the value for the Objects property.
SetCapacityprotectedSets the value for the Capacity property.
SetCountprotectedSets the value for the Count property.
GrowprotectedIncreases the storage Capacity for the class instance.
ShrinkprotectedDecreases the Capacity and allocated storage for the class instance.
DestroypublicDestructor for the class instance.
AddpublicAdds the specified item to the storage for the class instance.
AddObjectpublicAdds the specified item and its associated object to the storage in the class instance.
ClearpublicRemoves all item/object associations stored in the List.
DeletepublicDeletes an item/object association stored at the specified position in the List.
ExchangepublicSwaps the item/object associations at the specified positions in List.
FirstpublicGets the first TItem class instance in the List, or Nil when empty.
IndexOfpublicGets the ordinal position in List where the specified TItem instance is stored.
InsertpublicInserts a new association at the specified position in List.
InsertObjectpublicInserts an item/object association at the specified position in the List.
LastpublicGets the last TItem instance in the List, or Nil when empty.
MovepublicRelocates the association stored at the position in CurIndex to the position in NewIndex.
AssignpublicAssigns TItem class instances specified in SrcList to the List storage in the class.
RemovepublicRemoves the association with the specified TItem class instance.
PackpublicRemoves all associations where the Item class instance is unassigned (contains Nil).

An experiment, built from Lazarus main 2dfa93c66e of 10-22-2026. Not the official Lazarus documentation.