Class TObjectsList_1

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TObjectsList_1 = class(TObjectsList_Abstract)

Description

Hierarchy

Overview

Methods

Public function High: Integer;
Public procedure Sort(FirstIndex, LastIndex: Cardinal; IsSmallerFunction: TObjectsListIsSmallerFunction_1); overload;
Public procedure Sort(IsSmallerFunction: TObjectsListIsSmallerFunction_1); overload;
Public procedure Insert(Index: integer; Item: TObjectsListItem_1);
Public procedure InsertArray(Index: integer; const A: array of TObjectsListItem_1);
Public procedure InsertList(Index: integer; List: TObjectsList_1);
Public procedure Add(Item: TObjectsListItem_1);
Public procedure AddArray(const A: array of TObjectsListItem_1);
Public procedure AddList(List: TObjectsList_1);
Public function IndexOf(Item: TObjectsListItem_1; StartIndex: integer): integer; overload;
Public function IndexOf(Item: TObjectsListItem_1): integer; overload;
Public procedure Delete(Index: integer); overload;
Public function Delete(Item: TObjectsListItem_1): boolean; overload;
Public function DeleteAll(Item: TObjectsListItem_1): integer;
Public procedure DeleteDuplicates;
Public procedure Clear;
Public procedure Exchange(index1, index2: integer);
Public procedure Move(oldIndex, newIndex: integer);
Public procedure ReplaceAll(OldItem, NewItem: TObjectsListItem_1);
Public procedure FreeAndNil(Index: integer);
Public procedure FreeContents; override;
Public constructor Create;
Public constructor CreateFromArray(const InitialItems: array of TObjectsListItem_1);
Public constructor CreateFromList(InitialItems: TObjectsList_1);
Public destructor Destroy; override;

Properties

Public property Items[i: integer]: TObjectsListItem_1 read GetItem write SetItem;
Public property Count: Integer read fCount write SetCount;
Public property Capacity: integer read fCapacity write SetCapacity;
Public property First: TObjectsListItem_1 read GetFirst write SetFirst;
Public property Last: TObjectsListItem_1 read GetLast write SetLast;

Description

Methods

Public function High: Integer;

Shortcut for Count - 1. Yes, when Count = 0, High is -1.

Public procedure Sort(FirstIndex, LastIndex: Cardinal; IsSmallerFunction: TObjectsListIsSmallerFunction_1); overload;

Sort Items between FirstIndex and LastIndex. FirstIndex and LastIndex must be valid indexes, i.e. between 0 and High and FirstIndex <= LastIndex.

Public procedure Sort(IsSmallerFunction: TObjectsListIsSmallerFunction_1); overload;

Sorts all items.

Public procedure Insert(Index: integer; Item: TObjectsListItem_1);
 
Public procedure InsertArray(Index: integer; const A: array of TObjectsListItem_1);
 
Public procedure InsertList(Index: integer; List: TObjectsList_1);
 
Public procedure Add(Item: TObjectsListItem_1);

Add always adds at the end of the list. In other words, AddXxx(...) is always just a shortcut for InsertXxx(Count, ...).

Public procedure AddArray(const A: array of TObjectsListItem_1);
 
Public procedure AddList(List: TObjectsList_1);
 
Public function IndexOf(Item: TObjectsListItem_1; StartIndex: integer): integer; overload;

szuka zaczynajac od StartIndex obiektu Item , zwraca -1 jesli nie znalazl. Jesli nie podasz StartIndex to tak jakbys podal StartIndex = 0.

Public function IndexOf(Item: TObjectsListItem_1): integer; overload;
 
Public procedure Delete(Index: integer); overload;
 
Public function Delete(Item: TObjectsListItem_1): boolean; overload;

Robi IndexOf i Delete(integer), jezeli znalazl. Zwraca czy znalazl (czyli czy zrobil Delete(integer)).

Public function DeleteAll(Item: TObjectsListItem_1): integer;

DeleteAll robi Delete(integer) dopoki IndexOf znajduje. Zwraca ile elementow usunal (czyli o ile zmalalo Count).

Public procedure DeleteDuplicates;

dla kazdego obiektu na liscie kasuje wszystkie jego nastepujace duplikaty

Public procedure Clear;

Equivalent to doing Count := 0

Public procedure Exchange(index1, index2: integer);

przesuwanie, zmienianie

Public procedure Move(oldIndex, newIndex: integer);
 
Public procedure ReplaceAll(OldItem, NewItem: TObjectsListItem_1);

zamieni wszystkie wystapienia OldItem na NewItem

Public procedure FreeAndNil(Index: integer);
 
Public procedure FreeContents; override;

robi jakby Clear tyle ze wszystkim wyrzucanym obiektom robi najpierw .Free. Jesli nie masz pewnosci - upewnij sie najpierw ze na liscie nie ma duplikatow przez DeleteDuplicates

Public constructor Create;

procedure FreeWithContents; in _Abstract

Public constructor CreateFromArray(const InitialItems: array of TObjectsListItem_1);

Inits list contents with InitialItems. This is just a shortcut for Create + AddArray(InitialItems).

Public constructor CreateFromList(InitialItems: TObjectsList_1);

Similiar to CreateFromArray: shortcut for Create + AddList(InitialItems)

Public destructor Destroy; override;
 

Properties

Public property Items[i: integer]: TObjectsListItem_1 read GetItem write SetItem;
 
Public property Count: Integer read fCount write SetCount;

ustawianie Counta : zmniejszanie oznacza kasowanie koncowych elementow, zwiekszanie - dodawanie nil'i

Public property Capacity: integer read fCapacity write SetCapacity;
 
Public property First: TObjectsListItem_1 read GetFirst write SetFirst;

Shortcut for Items[0].

Public property Last: TObjectsListItem_1 read GetLast write SetLast;

Shortcut for Items[Count-1].


Generated by PasDoc 0.10.0 on 2006-07-12 06:44:38