Class TList

Unit

Declaration

type TList<T> = class(TCustomListWithPointers<T>)

Description

No description available, ancestor TCustomListWithPointers description follows
No description available, ancestor TCustomList description follows

More info: http://stackoverflow.com/questions/5232198/about-vectors-growth TODO: custom memory managers (as constraints) ˜approximation to golden ratio: n = n * 1.5 } {$DEFINE CUSTOM_LIST_CAPACITY_INC := Result * 2} // standard inc

Hierarchy

Overview

Internal Classes and Records

Public TEnumerator = class(TCustomListEnumerator<T>)

Fields

Private var FComparer: IComparer<T>;

Methods

Protected function DoGetEnumerator: TEnumerator<T>; override;
Public function GetEnumerator: TEnumerator; reintroduce;
Protected procedure SetCapacity(AValue: SizeInt); override;
Protected procedure SetCount(AValue: SizeInt);
Protected procedure InitializeList; virtual;
Protected procedure InternalInsert(AIndex: SizeInt; constref AValue: T);
Private function GetItem(AIndex: SizeInt): T;
Private procedure SetItem(AIndex: SizeInt; const AValue: T);
Public constructor Create; overload;
Public constructor Create(const AComparer: IComparer<T>); overload;
Public constructor Create(ACollection: TEnumerable<T>); overload;
Public destructor Destroy; override;
Public function Add(constref AValue: T): SizeInt; virtual;
Public procedure AddRange(constref AValues: array of T); virtual; overload;
Public procedure AddRange(const AEnumerable: IEnumerable<T>); overload;
Public procedure AddRange(AEnumerable: TEnumerable<T>); overload;
Public procedure Insert(AIndex: SizeInt; constref AValue: T); virtual;
Public procedure InsertRange(AIndex: SizeInt; constref AValues: array of T); virtual; overload;
Public procedure InsertRange(AIndex: SizeInt; const AEnumerable: IEnumerable<T>); overload;
Public procedure InsertRange(AIndex: SizeInt; const AEnumerable: TEnumerable<T>); overload;
Public function Remove(constref AValue: T): SizeInt;
Public procedure Delete(AIndex: SizeInt); inline;
Public procedure DeleteRange(AIndex, ACount: SizeInt);
Public function ExtractIndex(const AIndex: SizeInt): T; overload;
Public function Extract(constref AValue: T): T; overload;
Public procedure Exchange(AIndex1, AIndex2: SizeInt); virtual;
Public procedure Move(AIndex, ANewIndex: SizeInt); virtual;
Public function First: T; inline;
Public function Last: T; inline;
Public procedure Clear;
Public function Contains(constref AValue: T): Boolean; inline;
Public function IndexOf(constref AValue: T): SizeInt; virtual;
Public function LastIndexOf(constref AValue: T): SizeInt; virtual;
Public procedure Reverse;
Public procedure TrimExcess; override;
Public procedure Sort; overload;
Public procedure Sort(const AComparer: IComparer<T>); overload;
Public function BinarySearch(constref AItem: T; out AIndex: SizeInt): Boolean; overload;
Public function BinarySearch(constref AItem: T; out AIndex: SizeInt; const AComparer: IComparer<T>): Boolean; overload;

Properties

Public property Count: SizeInt read FLength write SetCount;
Public property Items[Index:SizeInt]: T read GetItem write SetItem;

Description

Fields

Private var FComparer: IComparer<T>;
 

Methods

Protected function DoGetEnumerator: TEnumerator<T>; override;

bug #24287 - workaround for generics type name conflict (Identifier not found) next bug workaround - for another error related to previous workaround change order (method must be declared before TEnumerator declaration)

Public function GetEnumerator: TEnumerator; reintroduce;
 
Protected procedure SetCapacity(AValue: SizeInt); override;
 
Protected procedure SetCount(AValue: SizeInt);
 
Protected procedure InitializeList; virtual;
 
Protected procedure InternalInsert(AIndex: SizeInt; constref AValue: T);
 
Private function GetItem(AIndex: SizeInt): T;
 
Private procedure SetItem(AIndex: SizeInt; const AValue: T);
 
Public constructor Create; overload;
 
Public constructor Create(const AComparer: IComparer<T>); overload;
 
Public constructor Create(ACollection: TEnumerable<T>); overload;
 
Public destructor Destroy; override;
 
Public function Add(constref AValue: T): SizeInt; virtual;
 
Public procedure AddRange(constref AValues: array of T); virtual; overload;
 
Public procedure AddRange(const AEnumerable: IEnumerable<T>); overload;
 
Public procedure AddRange(AEnumerable: TEnumerable<T>); overload;
 
Public procedure Insert(AIndex: SizeInt; constref AValue: T); virtual;
 
Public procedure InsertRange(AIndex: SizeInt; constref AValues: array of T); virtual; overload;
 
Public procedure InsertRange(AIndex: SizeInt; const AEnumerable: IEnumerable<T>); overload;
 
Public procedure InsertRange(AIndex: SizeInt; const AEnumerable: TEnumerable<T>); overload;
 
Public function Remove(constref AValue: T): SizeInt;
 
Public procedure Delete(AIndex: SizeInt); inline;
 
Public procedure DeleteRange(AIndex, ACount: SizeInt);
 
Public function ExtractIndex(const AIndex: SizeInt): T; overload;
 
Public function Extract(constref AValue: T): T; overload;
 
Public procedure Exchange(AIndex1, AIndex2: SizeInt); virtual;
 
Public procedure Move(AIndex, ANewIndex: SizeInt); virtual;
 
Public function First: T; inline;
 
Public function Last: T; inline;
 
Public procedure Clear;
 
Public function Contains(constref AValue: T): Boolean; inline;
 
Public function IndexOf(constref AValue: T): SizeInt; virtual;
 
Public function LastIndexOf(constref AValue: T): SizeInt; virtual;
 
Public procedure Reverse;
 
Public procedure TrimExcess; override;
 
Public procedure Sort; overload;
 
Public procedure Sort(const AComparer: IComparer<T>); overload;
 
Public function BinarySearch(constref AItem: T; out AIndex: SizeInt): Boolean; overload;
 
Public function BinarySearch(constref AItem: T; out AIndex: SizeInt; const AComparer: IComparer<T>): Boolean; overload;
 

Properties

Public property Count: SizeInt read FLength write SetCount;
 
Public property Items[Index:SizeInt]: T read GetItem write SetItem;
 

Generated by PasDoc 0.15.0.