TFPList class
Class to manage collections of pointers.
Declaration
TFPList = class(TObject)Inheritance
- TFPList
- TObject
Descends from it: TNamedItemList
Description
TFPList 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. Contrary to
TList,
TFPList has no notification mechanism. If no notification
mechanism is used, it is better to use
TFPList instead of
TList, as the performance of
TFPList is much higher.
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 | |
Put | protected | |
SetCapacity | protected | |
SetCount | protected | |
RaiseIndexError | protected | |
CheckIndex | protected | |
Destroy | public | Destroys the list and releases the memory used to store the list elements. |
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. |
IndexOfItem | public | Search an item in the list. |
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 | Assign performs the given operation on the list. |
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. |
ForEachCall | public | Call a procedure or method for each pointer in the list. |
Types and constants
TDirection | public | Search direction for IndexOfItem. |
Inherited
From TObject (41)
AfterConstruction BeforeDestruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance Create 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.
