Sign in Join
FPDoc Onlineexperiment

TCollection object

In unit Objects

Manage a collection of pointers of objects.

Declaration

pascal
TCollection = class(TObject)

Inheritance

  1. TCollection
  2. TObject

Descends from it: TCheckConstraints TConditionalStrings TCookies TCoolBands TCustomWebActions TDaemonDefs TDependencies TDialogButtons TFPExprIdentifierDefs TGridColumns THeaderSections THTTPRouteList TIniCollection TLCLCollection TListColumns TMediatorDefs TMediatorFieldInfoList TMimeItems TModuleFactory TNamedCollection TNotifyEventCollection TOwnedCollection TParams TPropertyMap TRequestInterceptorList TSortedCollection TSqlObjectIdentifierList TStatusPanels TStreamCollection TTemplateVars TUploadedFiles TZipFileEntries

Description

The TCollection object manages a collection of pointers or objects. It also provides a series of methods to manipulate these pointers or objects.

Whether or not objects are used depends on the kind of calls you use. All kinds come in 2 flavors, one for objects, one for pointers.

Methods

InitInstantiate a new collection.
LoadInitialize a new collection and load collection from a stream.
DoneClean up collection, release all memory.
AtReturn the item at a certain index.
IndexOfFind the position of a certain item.
GetItemRead one item off the stream.
LastThatReturn last item which matches a test.
FirstThatReturn first item which matches a test.
PackRemove all >Nil pointers from the collection.
FreeAllRelease all objects from the collection.
DeleteAllDelete all elements from the collection. Objects are not destroyed.
FreeFree item from collection, calling it's destructor.
InsertInsert a new item in the collection at the end.
DeleteDelete an item from the collection, but does not destroy it.
AtFreeFree an item at the indicates position, calling it's destructor.
FreeItemDestroy a non-nil item.
AtDeleteDelete item at certain position.
ForEachExecute procedure for each item in the list.
SetLimitSet maximum number of elements in the collection.
ErrorSet error code.
AtPutSet collection item, overwriting an existing value.
AtInsertInsert an element at a certain position in the collection.
StoreWrite collection to a stream.
PutItemPut one item on the stream.

Fields

ItemsPointer to list of items.
CountCurrent count of items.
LimitMax number of items.
DeltaNumber of pointers to allocate when adding items.

Inherited

From TObject (41)

AfterConstruction BeforeDestruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance Create DefaultHandler DefaultHandlerStr Destroy Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress 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.