Class TGenList

DescriptionHierarchyInternal TypesFieldsMethodsProperties

Unit

Declaration

type generic TGenList<_TItem_> = class(TAbstractList)

Description

no description available, TAbstractList description follows
no description available, TContainer description follows

Hierarchy

Overview

Internal Types

Public PItem = ˆ_TItem_;
Published TCompareItems = function (const A, B: _TItem_) : Integer of object;
Public TEnumerator = specialize TGenEnumerator<_TItem_, TListCursor>;
Published TItemToString = function (const Item: _TItem_) : String of object;
Published TProcessItem = procedure(var Item: _TItem_) of object;

Methods

Protected function CursorIsFirst(const Cursor: TListCursor) : Boolean; override;
Protected function CursorIsLast(const Cursor: TListCursor) : Boolean; override;
Protected procedure CursorMoveNext(var Cursor: TListCursor); override;
Protected procedure CursorMovePrev(var Cursor: TListCursor); override;
Public procedure Append(const Item: _TItem_; Count: Integer = 1);
Public procedure AppendAll(Src: TGenList);
Public procedure AppendRange(Src: TGenList; const PosFrom, PosTo: TListCursor);
Public procedure Clear;
Public function Contains(const Item: _TItem_) : Boolean;
Public function Contains(const Item: _TItem_; Comparator: TCompareItems) : Boolean;
Public constructor Create;
Public function DefaultCompareItems(const A, B: _TItem_) : Integer; virtual;
Public function DefaultItemToString(const Item: _TItem_) : String; virtual;
Public procedure Delete(var Position: TListCursor; Count: Integer = 1);
Public procedure DeleteFirst(Count: Integer = 1);
Public procedure DeleteLast(Count: Integer = 1);
Public procedure DeleteRange(const PosFrom, PosTo: TListCursor);
Public destructor Destroy; override;
Public function Equals(Obj: TObject) : Boolean; override;
Public function Equals(Obj: TObject; Comparator: TCompareItems) : Boolean;
Public function Find(const Item: _TItem_) : TListCursor;
Public function Find(const Item: _TItem_; Comparator: TCompareItems) : TListCursor;
Public function Find(const Item: _TItem_; const Position: TListCursor) : TListCursor;
Public function Find(const Item: _TItem_; const Position: TListCursor; Comparator: TCompareItems): TListCursor;
Public function First: TListCursor;
Public function FirstItem : _TItem_; inline;
Public function GetCursor(Index: Integer): TListCursor;
Public function GetEnumerator : TEnumerator;
Public function GetItem(const Position: TListCursor) : _TItem_; inline;
Public function GetItemPtr(const Position: TListCursor) : PItem; inline;
Public procedure Insert(const Before: TListCursor; const Item: _TItem_; Count: Integer = 1);
Public procedure Insert(const Before: TListCursor; const Item: _TItem_; out Position: TListCursor; Count: Integer);
Public procedure InsertAll(const Before: TListCursor; Src: TGenList);
Public procedure InsertRange(const Before : TListCursor; Src: TGenList; const PosFrom, PosTo: TListCursor);
Public function IsEmpty: Boolean; inline;
Public function IsSorted : Boolean;
Public function IsSorted(Comparator: TCompareItems) : Boolean;
Public procedure Iterate(Process: TProcessItem);
Public procedure Iterate(Process: TProcessItem; const PosFrom, PosTo: TListCursor);
Public function Last: TListCursor;
Public function LastItem: _TItem_; inline;
Public procedure Merge(Src: TGenList);
Public procedure Merge(Src: TGenList; Comparator: TCompareItems);
Public procedure Prepend(const Item: _TItem_; Count: Integer = 1);
Public procedure PrependAll(Src: TGenList);
Public procedure PrependRange(Src: TGenList; const PosFrom, PosTo: TListCursor);
Public procedure ReadFirstItem(out Value : _TItem_); inline;
Public procedure ReadItem(const Position: TListCursor; out Value: _TItem_);
Public procedure ReadItemFast(const Position: TListCursor; out Value: _TItem_); inline;
Public procedure ReadLastItem(out Value : _TItem_); inline;
Public procedure Replace(const Position: TListCursor; Count: Integer; const Value: _TItem_);
Public procedure Reverse;
Public function ReverseFind(const Item: _TItem_) : TListCursor;
Public function ReverseFind(const Item: _TItem_; Comparator: TCompareItems): TListCursor;
Public function ReverseFind(const Item: _TItem_; const Position: TListCursor) : TListCursor;
Public function ReverseFind(const Item: _TItem_; const Position: TListCursor; Comparator: TCompareItems) : TListCursor;
Public procedure ReverseRange(const PosFrom, PosTo: TListCursor);
Public procedure SetItem(const Position: TListCursor; const Value: _TItem_);
Public procedure SetItemFast(const Position: TListCursor; const Value: _TItem_); inline;
Public procedure Sort;
Public procedure Sort(Comparator: TCompareItems);
Public procedure Sort(const PosFrom, PosTo: TListCursor);
Public procedure Sort(const PosFrom, PosTo: TListCursor; Comparator: TCompareItems);
Public procedure Splice(const Before: TListCursor; Src: TGenList);
Public procedure Splice(const Before: TListCursor; Src: TGenList; const Position: TListCursor);
Public procedure Splice(const Before: TListCursor; Src: TGenList; const SrcFrom, SrcTo: TListCursor);
Public procedure Swap(const I, J: TListCursor);
Public procedure SwapLinks(const I, J: TListCursor);
Public function ToString : String; override;

Properties

Public property Items[constIndex:TListCursor]: _TItem_ read GetItemFast write SetItemFast;
Public property ItemsPtr[constIndex:TListCursor]: PItem read GetItemPtrFast;
Public property NilCursor: TListCursor read fNilCursor;
Public property OnCompareItems : TCompareItems read fOnCompareItems write SetOnCompareItems;
Public property OnItemToString : TItemToString read fOnItemToString write SetOnItemToString;
Public property Size: Integer read fSize;

Description

Internal Types

Public PItem = ˆ_TItem_;
 
Published TCompareItems = function (const A, B: _TItem_) : Integer of object;
 
Public TEnumerator = specialize TGenEnumerator<_TItem_, TListCursor>;
 
Published TItemToString = function (const Item: _TItem_) : String of object;
 
Published TProcessItem = procedure(var Item: _TItem_) of object;
 

Methods

Protected function CursorIsFirst(const Cursor: TListCursor) : Boolean; override;
 
Protected function CursorIsLast(const Cursor: TListCursor) : Boolean; override;
 
Protected procedure CursorMoveNext(var Cursor: TListCursor); override;
 
Protected procedure CursorMovePrev(var Cursor: TListCursor); override;
 
Public procedure Append(const Item: _TItem_; Count: Integer = 1);

Inserts Count times Item at the end of the container.

Public procedure AppendAll(Src: TGenList);

Inserts all the items of Src at the end of the container.

Public procedure AppendRange(Src: TGenList; const PosFrom, PosTo: TListCursor);

Inserts all the items of Src in the range [PosFrom..PosTo] at the end of the container.

Public procedure Clear;

Removes all the items from the container.

Public function Contains(const Item: _TItem_) : Boolean;

Returns true if the container contains Item.

Public function Contains(const Item: _TItem_; Comparator: TCompareItems) : Boolean;
 
Public constructor Create;

Creates an empty list.

Public function DefaultCompareItems(const A, B: _TItem_) : Integer; virtual;
 
Public function DefaultItemToString(const Item: _TItem_) : String; virtual;
 
Public procedure Delete(var Position: TListCursor; Count: Integer = 1);

Deletes Count items begining at Position and then sets Position to NilCursor.

Public procedure DeleteFirst(Count: Integer = 1);

Deletes the first Count items.

Public procedure DeleteLast(Count: Integer = 1);

Deletes the last Count items.

Public procedure DeleteRange(const PosFrom, PosTo: TListCursor);

Deletes all items in the range [PosFrom..PosTo].

Public destructor Destroy; override;

Destroys the container.

Public function Equals(Obj: TObject) : Boolean; override;

If Obj = Self then returns true, else if Obj is not a TGenList returns false, else returns true if Self and Obj contain the sames items.

Public function Equals(Obj: TObject; Comparator: TCompareItems) : Boolean;
 
Public function Find(const Item: _TItem_) : TListCursor;

Returns a cursor on the first item equal to Item or NilCursor.

Public function Find(const Item: _TItem_; Comparator: TCompareItems) : TListCursor;
 
Public function Find(const Item: _TItem_; const Position: TListCursor) : TListCursor;

Returns a cursor on the first item equal to Item or NilCursor.The search starts at the first element if Position is NilCursor, and at the element designated by Position otherwise.

Public function Find(const Item: _TItem_; const Position: TListCursor; Comparator: TCompareItems): TListCursor;
 
Public function First: TListCursor;

Returns a cursor that designates the first element of the container or NilCursor if the container is empty.

Public function FirstItem : _TItem_; inline;

Returns the first Item.

Public function GetCursor(Index: Integer): TListCursor;

If Index is not in the range [0..Size - 1], then returns NilCursor. Otherwise, returns a cursor designating the item at position Index.

Public function GetEnumerator : TEnumerator;
 
Public function GetItem(const Position: TListCursor) : _TItem_; inline;

Returns the item designated by Position.

Public function GetItemPtr(const Position: TListCursor) : PItem; inline;

Returns a pointer designating the item designated by Position.

Public procedure Insert(const Before: TListCursor; const Item: _TItem_; Count: Integer = 1);

Inserts Count times Item before Before.

Public procedure Insert(const Before: TListCursor; const Item: _TItem_; out Position: TListCursor; Count: Integer);

Inserts Count times Item before Before. Position designates the first newly-inserted element.

Public procedure InsertAll(const Before: TListCursor; Src: TGenList);

Inserts all the items of Src before Before.

Public procedure InsertRange(const Before : TListCursor; Src: TGenList; const PosFrom, PosTo: TListCursor);

Inserts before Before all the items of Src in the range [PosFrom..PosTo].

Public function IsEmpty: Boolean; inline;

Returns true if the list is empty.

Public function IsSorted : Boolean;

Returns True if the items are sorted.

Public function IsSorted(Comparator: TCompareItems) : Boolean;
 
Public procedure Iterate(Process: TProcessItem);
 
Public procedure Iterate(Process: TProcessItem; const PosFrom, PosTo: TListCursor);
 
Public function Last: TListCursor;

Returns a cursor that designates the last element of the container or NilCursor if the container is empty.

Public function LastItem: _TItem_; inline;

Returns the last Item.

Public procedure Merge(Src: TGenList);

Removes items from Src and inserts them into Self. Afterwards, Self contains the union of the items that were initially in Src and Self. Src is left empty. If Self and Src are initially sorted, then Self is sorted.

Public procedure Merge(Src: TGenList; Comparator: TCompareItems);
 
Public procedure Prepend(const Item: _TItem_; Count: Integer = 1);

Inserts Count times Item at the begining of the container.

Public procedure PrependAll(Src: TGenList);

Inserts all the items of Src at the begining of the container.

Public procedure PrependRange(Src: TGenList; const PosFrom, PosTo: TListCursor);

Inserts all the items of Src in the range [PosFrom..PosTo] at the begining of the container.

Public procedure ReadFirstItem(out Value : _TItem_); inline;
 
Public procedure ReadItem(const Position: TListCursor; out Value: _TItem_);
 
Public procedure ReadItemFast(const Position: TListCursor; out Value: _TItem_); inline;
 
Public procedure ReadLastItem(out Value : _TItem_); inline;
 
Public procedure Replace(const Position: TListCursor; Count: Integer; const Value: _TItem_);

Replaces items in range [Position..Position + Count - 1] by Value.

Public procedure Reverse;

Reorders the items in reverse order.

Public function ReverseFind(const Item: _TItem_) : TListCursor;

Returns a cursor on the first item equal to Item or NilCursor.

Public function ReverseFind(const Item: _TItem_; Comparator: TCompareItems): TListCursor;
 
Public function ReverseFind(const Item: _TItem_; const Position: TListCursor) : TListCursor;

Returns a cursor on the first item equal to Item or NilCursor.The search starts at the last element if Position is NilCursor, and at the element designated by Position otherwise.

Public function ReverseFind(const Item: _TItem_; const Position: TListCursor; Comparator: TCompareItems) : TListCursor;
 
Public procedure ReverseRange(const PosFrom, PosTo: TListCursor);

Reorders the items in the range [PosFrom..PosTo] in reverse order.

Public procedure SetItem(const Position: TListCursor; const Value: _TItem_);

Assigns the value Value to the item designated by Position.

Public procedure SetItemFast(const Position: TListCursor; const Value: _TItem_); inline;
 
Public procedure Sort;

Sorts the items.

Public procedure Sort(Comparator: TCompareItems);
 
Public procedure Sort(const PosFrom, PosTo: TListCursor);

Sorts the items in the range [PosFrom..PosTo].

Public procedure Sort(const PosFrom, PosTo: TListCursor; Comparator: TCompareItems);
 
Public procedure Splice(const Before: TListCursor; Src: TGenList);

Removes all items of Src and moves them to Self before Before.

Public procedure Splice(const Before: TListCursor; Src: TGenList; const Position: TListCursor);

Removes from Src the item designated by Position and moves it to Self before Before.

Public procedure Splice(const Before: TListCursor; Src: TGenList; const SrcFrom, SrcTo: TListCursor);

Removes all items of Src in the range [SrcFrom..SrcTo] and moves them to Self before Before.

Public procedure Swap(const I, J: TListCursor);

Swaps the values of the items designated by I and J.

Public procedure SwapLinks(const I, J: TListCursor);

Swaps the nodes designated by I and J.

Public function ToString : String; override;

Return a string representation for the container.

Properties

Public property Items[constIndex:TListCursor]: _TItem_ read GetItemFast write SetItemFast;

Provides access to the items in the container.

Public property ItemsPtr[constIndex:TListCursor]: PItem read GetItemPtrFast;

Provides access to pointers on the items in the container.

Public property NilCursor: TListCursor read fNilCursor;

A nil cursor.

Public property OnCompareItems : TCompareItems read fOnCompareItems write SetOnCompareItems;
 
Public property OnItemToString : TItemToString read fOnItemToString write SetOnItemToString;
 
Public property Size: Integer read fSize;

Number of elements in the list.


Generated by PasDoc 0.13.0 on 2014-07-29 16:12:40