| [Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | 
[Properties (by Name)] [Methods (by Name)] [Events (by Name)]
Manage a collection of pointers of objects
Source position: objects.pp line 404
type TCollection = object(TObject)  | 
||
  | 
Pointer to list of items.  | 
|
  | 
Current count of items  | 
|
  | 
Max number of items  | 
|
  | 
Number of pointers to allocate when adding items.  | 
|
constructor Init();  | 
  | 
Instantiate a new collection.  | 
constructor Load();  | 
  | 
Initialize a new collection and load collection from a stream.  | 
destructor Done; virtual;  | 
  | 
Clean up collection, release all memory.  | 
function At();  | 
  | 
Return the item at a certain index.  | 
function IndexOf(); virtual;  | 
  | 
Find the position of a certain item.  | 
function GetItem(); virtual;  | 
  | 
Read one item off the stream.  | 
function LastThat();  | 
  | 
Return last item which matches a test.  | 
function FirstThat();  | 
  | 
Return first item which matches a test.  | 
procedure Pack;  | 
  | 
Remove all >Nil pointers from the collection.  | 
procedure FreeAll;  | 
  | 
Release all objects from the collection.  | 
procedure DeleteAll;  | 
  | 
Delete all elements from the collection. Objects are not destroyed.  | 
procedure Free();  | 
  | 
Free item from collection, calling it's destructor.  | 
procedure Insert(); virtual;  | 
  | 
Insert a new item in the collection at the end.  | 
procedure Delete();  | 
  | 
Delete an item from the collection, but does not destroy it.  | 
procedure AtFree();  | 
  | 
Free an item at the indicates position, calling it's destructor.  | 
procedure FreeItem(); virtual;  | 
  | 
Destroy a non-nil item.  | 
procedure AtDelete();  | 
  | 
Delete item at certain position.  | 
procedure ForEach();  | 
  | 
Execute procedure for each item in the list.  | 
procedure SetLimit(); virtual;  | 
  | 
Set maximum number of elements in the collection.  | 
procedure Error(); virtual;  | 
  | 
Set error code.  | 
procedure AtPut();  | 
  | 
Set collection item, overwriting an existing value.  | 
procedure AtInsert();  | 
  | 
Insert an element at a certain position in the collection.  | 
procedure Store();  | 
  | 
Write collection to a stream.  | 
procedure PutItem(); virtual;  | 
  | 
Put one item on the stream  | 
end;  | 
  | 
Manage a collection of pointers of objects  | 
|
  | 
Basis of all objects  | 
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.