Class TGenDeque

DescriptionHierarchyInternal TypesFieldsMethodsProperties

Unit

Declaration

type generic TGenDeque<_TItem_> = class(TAbstractVector)

Description

no description available, TAbstractVector 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_, Integer>;
Published TItemToString = function (const Item: _TItem_) : String of object;
Published TProcessItem = procedure(var Item: _TItem_) of object;

Methods

Protected procedure InsertSpaceFast(Position, Count: Integer); override;
Protected function ItemToString(Index: Integer) : String; override;
Protected procedure SetCapacity(ACapacity : Integer); override;
Public procedure Append(const Item: _TItem_; Count: Integer = 1);
Public procedure AppendAll(Src: TGenDeque);
Public procedure AppendRange(Src: TGenDeque; PosFrom, PosTo: Integer);
Public function BinarySearch(const Item: _TItem_) : Integer;
Public function BinarySearch(const Item: _TItem_; Comparator: TCompareItems) : Integer;
Public function BinarySearch(const Item: _TItem_; PosFrom, PosTo: Integer) : Integer;
Public function BinarySearch(const Item: _TItem_; PosFrom, PosTo: Integer; Comparator: TCompareItems) : Integer;
Public function Contains(const Item: _TItem_) : Boolean;
Public function Contains(const Item: _TItem_; Comparator: TCompareItems) : Boolean;
Public constructor Create(InitialCapacity: Integer = 16);
Public function DefaultCompareItems(const A, B: _TItem_) : Integer; virtual;
Public function DefaultItemToString(const Item: _TItem_) : String; virtual;
Public destructor Destroy; override;
Public function Equals(Obj: TObject) : Boolean; override;
Public function Equals(Obj: TObject; Comparator: TCompareItems) : Boolean;
Public function FindIndex(const Item: _TItem_) : Integer;
Public function FindIndex(const Item: _TItem_; Comparator: TCompareItems) : Integer;
Public function FindIndex(const Item: _TItem_; PosFrom: Integer) : Integer;
Public function FindIndex(const Item: _TItem_; PosFrom: Integer; Comparator: TCompareItems) : Integer;
Public function FirstItem : _TItem_; inline;
Public function GetEnumerator : TEnumerator;
Public function GetItemFast(Position: Integer) : _TItem_; inline;
Public function GetItem(Position: Integer) : _TItem_; inline;
Public function GetItemPtr(Position: Integer): PItem;
Public procedure Insert(Before: Integer; const Item: _TItem_; Count: Integer = 1);
Public procedure InsertAll(Before: Integer; Src: TGenDeque);
Public procedure InsertRange(Before: Integer; Src: TGenDeque; PosFrom, PosTo: Integer);
Public function IsSorted: Boolean;
Public function IsSorted(Comparator: TCompareItems): Boolean;
Public procedure Iterate(Process: TProcessItem);
Public procedure Iterate(Process: TProcessItem; const PosFrom, PosTo: Integer);
Public function LastItem: _TItem_; inline;
Public function MaxPos : Integer;
Public function MaxPos(Comparator: TCompareItems) : Integer;
Public function MaxPos(PosFrom, PosTo: Integer) : Integer;
Public function MaxPos(PosFrom, PosTo: Integer; Comparator: TCompareItems) : Integer;
Public procedure Merge(Src: TGenDeque);
Public procedure Merge(Src: TGenDeque; Comparator: TCompareItems);
Public function MinPos : Integer;
Public function MinPos(Comparator: TCompareItems) : Integer;
Public function MinPos(PosFrom, PosTo: Integer) : Integer;
Public function MinPos(PosFrom, PosTo: Integer; Comparator: TCompareItems) : Integer;
Public procedure Move(Src, Dst, Count: Integer); override;
Public procedure Prepend(const Item: _TItem_; Count: Integer = 1);
Public procedure PrependAll(Src: TGenDeque);
Public procedure PrependRange(Src: TGenDeque; PosFrom, PosTo: Integer);
Public procedure ReadFirstItem(out Value : _TItem_); inline;
Public procedure ReadItem(Position: Integer; out Value: _TItem_);
Public procedure ReadItemFast(Position: Integer; out Value: _TItem_); inline;
Public procedure ReadLastItem(out Value : _TItem_); inline;
Public procedure Replace(Index, Count: Integer; const Value: _TItem_);
Public function ReverseFindIndex(const Item: _TItem_) : Integer;
Public function ReverseFindIndex(const Item: _TItem_; Comparator: TCompareItems) : Integer;
Public function ReverseFindIndex(const Item: _TItem_; PosFrom: Integer) : Integer;
Public function ReverseFindIndex(const Item: _TItem_; PosFrom: Integer; Comparator: TCompareItems) : Integer;
Public procedure SetItem(Position: Integer; const Value: _TItem_); inline;
Public procedure SetItemFast(Position: Integer; const Value: _TItem_); inline;
Public procedure Sort;
Public procedure Sort(Comparator: TCompareItems);
Public procedure Sort(PosFrom, PosTo: Integer);
Public procedure Sort(PosFrom, PosTo: Integer; Comparator: TCompareItems);
Public procedure SwapFast(I, J: Integer); override;

Properties

Public property Items[Index:Integer]: _TItem_ read GetItemFast write SetItemFast;
Public property ItemsPtr[Index:Integer]: PItem read GetItemPtrFast;
Public property OnCompareItems : TCompareItems read fOnCompareItems write SetOnCompareItems;
Public property OnItemToString : TItemToString read fOnItemToString write SetOnItemToString;

Description

Internal Types

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

Methods

Protected procedure InsertSpaceFast(Position, Count: Integer); override;
 
Protected function ItemToString(Index: Integer) : String; override;
 
Protected procedure SetCapacity(ACapacity : Integer); override;
 
Public procedure Append(const Item: _TItem_; Count: Integer = 1);

Inserts Count times Item at the end of the container.

Public procedure AppendAll(Src: TGenDeque);

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

Public procedure AppendRange(Src: TGenDeque; PosFrom, PosTo: Integer);

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

Public function BinarySearch(const Item: _TItem_) : Integer;

Searches for Item using the binary search algorithm. Returns the index of Item if its found. Otherwise, returns ( - InsertionPoint - 1 ). InsertionPoint is the point at which the key would be inserted into the container.

Public function BinarySearch(const Item: _TItem_; Comparator: TCompareItems) : Integer;
 
Public function BinarySearch(const Item: _TItem_; PosFrom, PosTo: Integer) : Integer;

Searches for Item in range [PosFrom..PosTo] using the binary search algorithm. Returns the index of Item if its found. Otherwise, returns ( - InsertionPoint - 1 ). InsertionPoint is the point at which the key would be inserted into the range.

Public function BinarySearch(const Item: _TItem_; PosFrom, PosTo: Integer; Comparator: TCompareItems) : Integer;
 
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(InitialCapacity: Integer = 16);

Creates an empty deque and sets his capacity to InitialCapacity.

Public function DefaultCompareItems(const A, B: _TItem_) : Integer; virtual;
 
Public function DefaultItemToString(const Item: _TItem_) : String; virtual;
 
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 TGenDeque returns false, else returns True if Self and Obj contain the sames items.

Public function Equals(Obj: TObject; Comparator: TCompareItems) : Boolean;
 
Public function FindIndex(const Item: _TItem_) : Integer;

Returns the index of the first item equal to Item or -1.

Public function FindIndex(const Item: _TItem_; Comparator: TCompareItems) : Integer;
 
Public function FindIndex(const Item: _TItem_; PosFrom: Integer) : Integer;

Returns a cursor on the first item equal to Item or NilCursor. The search starts at the element From.

Public function FindIndex(const Item: _TItem_; PosFrom: Integer; Comparator: TCompareItems) : Integer;
 
Public function FirstItem : _TItem_; inline;

Returns the first Item.

Public function GetEnumerator : TEnumerator;
 
Public function GetItemFast(Position: Integer) : _TItem_; inline;
 
Public function GetItem(Position: Integer) : _TItem_; inline;

Returns item at position Position.

Public function GetItemPtr(Position: Integer): PItem;

Returns a pointer designating item at position Position.

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

Inserts Count times Item before Before.

Public procedure InsertAll(Before: Integer; Src: TGenDeque);

Inserts all the items of Src before Before.

Public procedure InsertRange(Before: Integer; Src: TGenDeque; PosFrom, PosTo: Integer);

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

Public function IsSorted: Boolean;

Returns true if the items are sorted.

Public function IsSorted(Comparator: TCompareItems): Boolean;
 
Public procedure Iterate(Process: TProcessItem);

Invokes Process on each items.

Public procedure Iterate(Process: TProcessItem; const PosFrom, PosTo: Integer);

Invokes Process on each items in range [PosFrom..PosTo].

Public function LastItem: _TItem_; inline;

Returns the last Item.

Public function MaxPos : Integer;

Returns index of the greatest item.

Public function MaxPos(Comparator: TCompareItems) : Integer;
 
Public function MaxPos(PosFrom, PosTo: Integer) : Integer;

Returns index of the greatest item in the range [PosFrom..PosTo].

Public function MaxPos(PosFrom, PosTo: Integer; Comparator: TCompareItems) : Integer;
 
Public procedure Merge(Src: TGenDeque);

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: TGenDeque; Comparator: TCompareItems);
 
Public function MinPos : Integer;

Returns index of the lowest item.

Public function MinPos(Comparator: TCompareItems) : Integer;
 
Public function MinPos(PosFrom, PosTo: Integer) : Integer;

Returns index of the lowest item in the range [PosFrom..PosTo].

Public function MinPos(PosFrom, PosTo: Integer; Comparator: TCompareItems) : Integer;
 
Public procedure Move(Src, Dst, Count: Integer); override;

Copies Count items from Src to Dst.

Public procedure Prepend(const Item: _TItem_; Count: Integer = 1);

Inserts Count times Item at the begining of the container.

Public procedure PrependAll(Src: TGenDeque);

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

Public procedure PrependRange(Src: TGenDeque; PosFrom, PosTo: Integer);

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(Position: Integer; out Value: _TItem_);
 
Public procedure ReadItemFast(Position: Integer; out Value: _TItem_); inline;
 
Public procedure ReadLastItem(out Value : _TItem_); inline;
 
Public procedure Replace(Index, Count: Integer; const Value: _TItem_);

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

Public function ReverseFindIndex(const Item: _TItem_) : Integer;

Returns the index of the first item equal to Item or -1.

Public function ReverseFindIndex(const Item: _TItem_; Comparator: TCompareItems) : Integer;
 
Public function ReverseFindIndex(const Item: _TItem_; PosFrom: Integer) : Integer;

Returns a cursor on the first item equal to Item or NilCursor. The search starts at the element From.

Public function ReverseFindIndex(const Item: _TItem_; PosFrom: Integer; Comparator: TCompareItems) : Integer;
 
Public procedure SetItem(Position: Integer; const Value: _TItem_); inline;

Assigns the value Value to the item at Position.

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

Sorts the items.

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

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

Public procedure Sort(PosFrom, PosTo: Integer; Comparator: TCompareItems);
 
Public procedure SwapFast(I, J: Integer); override;
 

Properties

Public property Items[Index:Integer]: _TItem_ read GetItemFast write SetItemFast;

Provides access to the items in the container.

Public property ItemsPtr[Index:Integer]: PItem read GetItemPtrFast;

Provides access to pointers on the items in the container.

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

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