Sign in Join
FPDoc Onlineexperiment

TObjectList class

In unit Contnrs

List to manage object instances.

Declaration

pascal
TObjectList = class(TList)

Inheritance

  1. TObjectList
  2. TList
  3. TObject

Descends from it: TComponentList

Description

TObjectList is a TList descendent which has as the default array property TObjects instead of pointers. By default it also manages the objects: when an object is deleted or removed from the list, it is automatically freed. This behaviour can be disabled when the list is created.

In difference with TFPObjectList, TObjectList offers a notification mechanism of list change operations: insert, delete. This slows down bulk operations, so if the notifications are not needed, TFPObjectList may be more appropriate.

See also

Properties

OwnsObjectspublicShould the list free elements when they are removed.
ItemspublicIndexed access to the elements of the list.

Methods

Notifyprotected
GetItemprotected
SetItemprotected
CreatepublicCreate a new object list.
AddpublicAdd an object to the list.
ExtractpublicExtract an object from the list.
RemovepublicRemove (and possibly free) an element from the list.
IndexOfpublicSearch for an object in the list.
FindInstanceOfpublicSearch for an instance of a certain class.
InsertpublicInsert an object in the list.
FirstpublicReturn the first non-nil object in the list.
LastpublicReturn the last non-nil object in the list.

Inherited

From TList (27)

AddList Assign Capacity Clear Contains Count Delete Destroy Error Exchange Expand FPOAttachObserver FPODetachObserver FPONotifyObservers Get GetCapacity GetCount GetEnumerator GetList Grow List Move Pack Put SetCapacity SetCount Sort

From TObject (40)

AfterConstruction BeforeDestruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName SafeCallException StringMessageTable SystemHasExtendedRTTI ToString UnitName

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.