TList class
Class to manage collections of pointers.
Declaration
TList = class(TObject)Inheritance
- TList
- TObject
Descends from it: TClassList TIcnsList TImageCacheItems TIniFileKeyList TIniFileSectionList TListWithEvent TMenuItems TMonitorList TObjectList TPropertiesToSkip TRefCntObjList
Description
TList is a class that can be used to manage collections of
pointers. It introduces methods and properties to store the pointers, search
in the list of pointers, sort them. It manages its memory by itself, no
intervention for that is needed. It has an event notification mechanism
which allows to notify of list changes. This slows down some of
TList mechanisms, and if no notification is used,
TFPList may be used instead.
To manage collections of strings, it is better to use a TStrings descendant such as TStringList. To manage general objects, a TCollection class exists, from which a descendant can be made to manage collections of various kinds.
See also
Properties
Capacity | public | Current capacity (i.e. number of pointers that can be stored) of the list. |
Count | public | Current number of pointers in the list. |
Items | public | Provides access to the pointers in the list. |
List | public | Memory array where pointers are stored. |
Methods
Get | protected | |
Grow | protected | |
Put | protected | |
Notify | protected | |
SetCapacity | protected | |
GetCapacity | protected | |
SetCount | protected | |
GetCount | protected | |
GetList | protected | |
Create | public | Class to manage collections of pointers. |
Destroy | public | Destroys the list and releases the memory used to store the list elements. |
FPOAttachObserver | public | Add an observer to the list of observers. |
FPODetachObserver | public | Remove an observer from the list of observers. |
FPONotifyObservers | public | Notify observers of changes in the list. |
AddList | public | Add all pointers from another list. |
Add | public | Adds a new pointer to the list. |
Clear | public | Clears the pointer list. |
Delete | public | Removes a pointer from the list. |
Error | public | Raises an exception. |
Exchange | public | Exchanges two pointers in the list. |
Expand | public | Increases the capacity of the list if needed. |
Extract | public | Remove the first occurrence of a pointer from the list. |
First | public | Returns the first non-nil pointer in the list. |
GetEnumerator | public | Create an IEnumerator instance. |
Contains | public | |
IndexOf | public | Returns the index of a given pointer. |
Insert | public | Inserts a new pointer in the list at a given position. |
Last | public | Returns the last non-nil pointer in the list. |
Move | public | Moves a pointer from one position in the list to another. |
Assign | public | Copy the contents of other lists. |
Remove | public | Removes a value from the list. |
Pack | public | Removes Nil pointers from the list and frees unused memory. |
Sort | public | Sorts the pointers in the list. |
Inherited
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.
