Class TSortedCollection (unit Collect)

Inherits from

TCollection

Constructors



Functions

function Compare (Key1,Key2 : Pointer): Integer;

if true, rejects item whose key already exists} {override this method to specify relation bewtween two keys 1 if Key1 comes after Key2, -1 if Key1 comes before Key2, 0 if Key1 is equivalent to Key2

function IndexOf (Item : Pointer): integer;

finds index of item by calling Search

procedure Insert (Item : Pointer);

finds item required position and performs insertion

function KeyOf (Item : Pointer): Pointer;

returns key of Item

function Search (key : Pointer; Var Index : integer) : Boolean;

finds index of item by performing an optimised search

Properties

Events

Variables

Duplicates : boolean;



Constructors


Functions


function Compare (Key1,Key2 : Pointer): Integer;

if true, rejects item whose key already exists} {override this method to specify relation bewtween two keys 1 if Key1 comes after Key2, -1 if Key1 comes before Key2, 0 if Key1 is equivalent to Key2


function IndexOf (Item : Pointer): integer;

finds index of item by calling Search


procedure Insert (Item : Pointer);

finds item required position and performs insertion


function KeyOf (Item : Pointer): Pointer;

returns key of Item


function Search (key : Pointer; Var Index : integer) : Boolean;

finds index of item by performing an optimised search


Properties


Events


Variables


Duplicates : boolean;