Changeset 77 for Generics/TemplateGenerics/Generic/ListInterface.tpl
- Timestamp:
- Oct 29, 2010, 1:26:32 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Generics/TemplateGenerics/Generic/ListInterface.tpl
r74 r77 1 2 PGListItem = ^TListItem; 3 TGList = class; 1 4 2 5 TGListSortCompare = function(const Item1, Item2: TListItem): Integer of object; 3 6 TGListStringConverter = function(Item: TListItem): string; 7 TGListOperation = procedure(List: TGList; Item: PGListItem); 4 8 //TGListNotification = (lnAdded, lnExtracted, lnDeleted); 5 9 … … 16 20 procedure SetCount(const AValue: TListIndex); 17 21 procedure QuickSort(L, R : TListIndex; Compare: TGListSortCompare); 18 property Capacity: TListIndex read GetCapacity write SetCapacity;19 22 public 20 23 // All items … … 24 27 procedure Sort(Compare: TGListSortCompare); 25 28 function Implode(Separator: string; Converter: TGListStringConverter): string; 29 procedure Perform(Operation: TGListOperation); 26 30 // Many items 27 31 procedure MoveItems(CurIndex, NewIndex, Count: TListIndex); 28 32 procedure DeleteItems(Index, Count: TListIndex); 33 procedure Fill(Start, Count: TListIndex; Value: TListItem); 29 34 // One item 30 35 function Add(Item: TListItem): TListIndex; … … 33 38 procedure Exchange(Index1, Index2: TListIndex); 34 39 function First: TListItem; 35 function IndexOf(Item: TListItem ): TListIndex;40 function IndexOf(Item: TListItem; Start: TListIndex = 0): TListIndex; 36 41 procedure Insert(Index: TListIndex; Item: TListItem); 37 42 function Last: TListItem; … … 42 47 procedure AddList(List: TGList); 43 48 procedure Assign(List: TGList); 44 //function Equals(Obj: TObject): Boolean; override;49 function Equals(List: TGList): Boolean; 45 50 procedure InsertList(Index: TListIndex; List: TGList); 51 function IndexOfList(List: TGList; Start: TListIndex = 0): TListIndex; 46 52 // Other 47 53 property Count: TListIndex read GetCount write SetCount; 48 // Additional 54 property Capacity: TListIndex read GetCapacity write SetCapacity; 55 // Array 49 56 procedure AddArray(Values: array of TListItem); 57 procedure SetArray(Values: array of TListItem); 58 procedure InsertArray(Index: TListIndex; Values: array of TListItem); 50 59 end;
Note:
See TracChangeset
for help on using the changeset viewer.