Class TCollection (unit Collect)

Inherits from

TObject

Constructors


constructor create(aLimit, aDelta : integer);

Current Number of Items


Functions

procedure AtFree(Index: Integer);

deletes and disposes Item at specified position

procedure AtInsert( Index : integer; Item : Pointer);

inserts Item at specified position

procedure Clear(Item: Pointer);

formerly Free, renamed to Clear to avoid bypassing inherited TObject.

procedure Delete( Item : Pointer);

deletes Item

move compensates for overlaps


procedure DeleteAll;

deletes all Items without disposing them

destructor destroy;

before deallocating object it disposes all items and the storage array

function FirstThat( Test : Pointer) : Pointer;

finds first item that satisfies condition specified in function Test( Item: pointer): boolean

procedure ForEach( Action : Pointer);

calls procedure Action( Item: pointer) for each item in collection

procedure FreeAll;

disposes all items; set counter to zero

function IndexOf( Item : Pointer) : integer;

finds position of Item using a linear search

procedure Insert( Item : Pointer);

inserts Item at the end of collection

function LastThat( Test : Pointer) : Pointer;

finds last item that satisfies condition specified in function Test( Item: pointer): boolean

procedure Pack;

packs collection by removing nil Items

procedure SetLimit( aLimit : integer);

expands array of pointers

procedure AtDelete (Index : integer);

Number of items by which the collection grows when full} { deletes item at index position

procedure Error (Code,Info : Integer);

generates CollException

procedure FreeItem (Item : Pointer);

destroys specified Item; override this method if Item is not a descendant of TObject

function At( Index : integer) : Pointer;

return item at index position

procedure AtPut( Index : integer; Item : Pointer);

replace item at index position

Properties

property Items : pointer

direct access to items through position

Events

Variables

Count : integer;


Delta : integer;

Current Allocated size of array

It : PPointerList;


Limit : integer;

array of pointers


Constructors


constructor create(aLimit, aDelta : integer);

Current Number of Items


Functions


procedure AtFree(Index: Integer);

deletes and disposes Item at specified position


procedure AtInsert( Index : integer; Item : Pointer);

inserts Item at specified position


procedure Clear(Item: Pointer);

formerly Free, renamed to Clear to avoid bypassing inherited TObject.Free; deletes and disposes Item


procedure Delete( Item : Pointer);

deletes Item

move compensates for overlaps


procedure DeleteAll;

deletes all Items without disposing them


destructor destroy;

before deallocating object it disposes all items and the storage array


function FirstThat( Test : Pointer) : Pointer;

finds first item that satisfies condition specified in function Test( Item: pointer): boolean


procedure ForEach( Action : Pointer);

calls procedure Action( Item: pointer) for each item in collection


procedure FreeAll;

disposes all items; set counter to zero


function IndexOf( Item : Pointer) : integer;

finds position of Item using a linear search


procedure Insert( Item : Pointer);

inserts Item at the end of collection


function LastThat( Test : Pointer) : Pointer;

finds last item that satisfies condition specified in function Test( Item: pointer): boolean


procedure Pack;

packs collection by removing nil Items


procedure SetLimit( aLimit : integer);

expands array of pointers


procedure AtDelete (Index : integer);

Number of items by which the collection grows when full} { deletes item at index position


procedure Error (Code,Info : Integer);

generates CollException


procedure FreeItem (Item : Pointer);

destroys specified Item; override this method if Item is not a descendant of TObject


function At( Index : integer) : Pointer;

return item at index position


procedure AtPut( Index : integer; Item : Pointer);

replace item at index position


Properties


property Items : pointer

direct access to items through position


Events


Variables


Count : integer;


Delta : integer;

Current Allocated size of array


It : PPointerList;


Limit : integer;

array of pointers