Units
Classes, Interfaces, Objects
Types
Variables
Constants
Functions, Procedures
Identifiers

Class TExContainerType

Unit

rjExIntegerVector

Declaration

type TExContainerType = class(TBase04Vector)

Description

Base class for TIntegerVector.

Hierarchy

TBase04Vector > TExVector > TExContainer > TErrorObject

Fields

None.

Methods

Overview

function ExistAllNumbers(const ANumbers: array of TExNumberType): Boolean;
function ExistAnyNumbers(const ANumbers: array of TExNumberType): Boolean;
function ExistsBackNumber(const ANumber: TExNumberType): Boolean;
function ExistsNumber(const ANumber: TExNumberType): Boolean;
function ExistsSortedNumber(const Number: TExNumberType): Boolean;
function FindDescNumber(const ANumber: TExNumberType; out Index: Integer): Boolean;
function FindNumber(const Number: TExNumberType; out Index: Integer): Boolean;
function GetFirstNumber: TExNumberType;
function GetLastNumber: TExNumberType;
function GetNumber(const Item: Pointer): TExNumberType;
function GetNumberAt(const Index: Integer): TExNumberType;
function IndexBackOfNumber(const ANumber: TExNumberType): Integer;
function IndexOfNumber(const ANumber: TExNumberType): Integer;
procedure InsertNumberAt(const Index: Integer; const ANumber: TExNumberType);
function InsertNumberFirst(const Number: TExNumberType): Integer;
function InsertNumberLast(const Number: TExNumberType): Integer;
function InsertNumberSorted(const ANumber: TExNumberType): Integer;
function InsertNumberSortedDesc(const ANumber: TExNumberType): Integer;
function ItemOfNumber(const Number: TExNumberType): Pointer;
procedure RemoveAllNumbers(const ANumber: TExNumberType);
procedure RemoveBackAllNumbers(const ANumber: TExNumberType);
procedure SetFirstNumber(const Number: TExNumberType);
procedure SetLastNumber(const Number: TExNumberType);
procedure SetNumber(const Item: Pointer; const Number: TExNumberType);
procedure SetNumberAt(const Index: Integer; const Number: TExNumberType);
procedure SortByNumber;
procedure SortByNumberDesc;

Description

function ExistAllNumbers(const ANumbers: array of TExNumberType): Boolean;

Returns True if all of the ANumbers in the array exist in the Items' Number Elements of the container, otherwise returns False. Comparison starts with the first Item.

function ExistAnyNumbers(const ANumbers: array of TExNumberType): Boolean;

Returns True if at least one of the ANumbers in the array exists in the Items' Number Elements of the container, otherwise returns False. Comparison starts with the first Item.

function ExistsBackNumber(const ANumber: TExNumberType): Boolean;

Returns True if ANumber exists among the Items' Number Elements of the container, otherwise returns False. Comparison starts with the last Item.

function ExistsNumber(const ANumber: TExNumberType): Boolean;

Returns True if ANumber exists among the Items' Number Elements of the container, otherwise returns False. Comparison starts with the first Item.

function ExistsSortedNumber(const Number: TExNumberType): Boolean;

 

function FindDescNumber(const ANumber: TExNumberType; out Index: Integer): Boolean;

 

function FindNumber(const Number: TExNumberType; out Index: Integer): Boolean;

 

function GetFirstNumber: TExNumberType;

Returns the Number Element of the first Item in the container.

function GetLastNumber: TExNumberType;

Returns the Number Element of the last Item in the container.

function GetNumber(const Item: Pointer): TExNumberType;

Returns the Number Element of the Item pointed to by Item.

function GetNumberAt(const Index: Integer): TExNumberType;

Returns the Number Element of the Item referenced by a 0-based Index.

function IndexBackOfNumber(const ANumber: TExNumberType): Integer;

Returns the position of the last occurrence of an Item whose Number Element is the same as ANumber. IndexBackOfNumber returns the 0-based Index of the Item, i.e. 0 for the first Item, 1 for the second, and so on. If ANumber is not in the vector, IndexBackOfNumber returns -1.

function IndexOfNumber(const ANumber: TExNumberType): Integer;

Returns the position of the first occurrence of an Item whose Number Element is the same as ANumber. IndexOfNumber returns the 0-based Index of the Item, i.e. 0 for the first Item, 1 for the second, and so on. If ANumber is not in the vector, IndexOfNumber returns -1.

procedure InsertNumberAt(const Index: Integer; const ANumber: TExNumberType);

Inserts a new Item at the position specified by Index and stores ANumber to the new Item's Number Element.

function InsertNumberFirst(const Number: TExNumberType): Integer;

Inserts a new Item to the beginning of the vector and stores Number to the new Item's Number Element. InsertNumberFirst returns the Index position of the new Item in the vector, where the first Item in the vector has an Index of 0.

function InsertNumberLast(const Number: TExNumberType): Integer;

Inserts a new Item to the end of the vector and stores Number to the new Item's Number Element. InsertNumberLast returns the Index position of the new Item in the vector, where the first Item in the vector has an Index of 0.

function InsertNumberSorted(const ANumber: TExNumberType): Integer;

Inserts a new Item at the appropriate position to a vector already sorted by its Items' Number Elements in ascending order. The new position will be based on comparisons with ANumber.

AddNumberSorted relies on the vector to be in sorted order already; do not use it on unsorted vectors. Call SortByNumber to prepare an unsorted vector for using AddNumberSorted.

AddNumberSorted does not allow duplicates in the vector. If ANumber is already present in the vector, no new Item will be inserted and ANumber will not be stored.

AddNumberSorted returns the Index position of the new Item in the vector, where the first Item in the vector has an Index of 0. If no new Item has been added (to avoid duplicates), the result will be -1.

function InsertNumberSortedDesc(const ANumber: TExNumberType): Integer;

Inserts a new Item at the appropriate position to a vector already sorted by its Items' Number Elements in descending order. The new position will be based on comparisons with ANumber.

AddNumberSortedDesc relies on the vector to be in sorted order already; do not use it on unsorted vectors. Call SortByNumberDesc to prepare an unsorted vector for using AddNumberSortedDesc.

AddNumberSortedDesc does not allow duplicates in the vector. If ANumber is already present in the vector, no new Item will be inserted and ANumber will not be stored.

AddNumberSortedDesc returns the Index position of the new Item in the vector, where the first Item in the vector has an Index of 0. If no new Item has been added (to avoid duplicates), the result will be -1.

function ItemOfNumber(const Number: TExNumberType): Pointer;

 

procedure RemoveAllNumbers(const ANumber: TExNumberType);

Removes all Items whose Number Element is the same as ANumber from the container.

procedure RemoveBackAllNumbers(const ANumber: TExNumberType);

Removes all Items whose Number Element is the same as ANumber from the container starting at the last Item.

procedure SetFirstNumber(const Number: TExNumberType);

Stores Number to the Number Element of the first Item in the container.

procedure SetLastNumber(const Number: TExNumberType);

Stores Number to the Number Element of the last Item in the container.

procedure SetNumber(const Item: Pointer; const Number: TExNumberType);

Stores Number to the Number Element of the Item pointed to by Item.

procedure SetNumberAt(const Index: Integer; const Number: TExNumberType);

Stores Number to the Number Element of the Item referenced by a 0-based Index.

procedure SortByNumber;

Sorts all Items in the container by their Number Element in ascending order.

procedure SortByNumberDesc;

Sorts all Items in the container by their Number Element in descending order.

Properties

Overview

FirstNumber: TExNumberType;
LastNumber: TExNumberType;
Number[const Item: Pointer]: TExNumberType;
NumberAt[const Index: Integer]: TExNumberType;

Description

FirstNumber: TExNumberType;

Reads or modifies the Number Element of the first Item in the container.

LastNumber: TExNumberType;

Reads or modifies the Number Element of the last Item in the container.

Number[const Item: Pointer]: TExNumberType;

Reads or writes the Number Element of the Item pointed to by Item.

NumberAt[const Index: Integer]: TExNumberType;

Lists the Number Element of the container's Items, referenced by a 0-based Index. Use Numbers to read or modify the Number Element of an Item at a particular position. Index gives the position of the Item, where 0 is the position of the first Item, 1 is the position of the second Item, and so on.


rjExContainer Library Version 0.2.
Copyright Ralf Junker 2000-2001.
http://www.zeitungsjunge.de/delphi/.