Class TGenHashSet

DescriptionHierarchyInternal TypesFieldsMethodsProperties

Unit

Declaration

type generic TGenHashSet<_TItem_> = class(TAbstractHashSet)

Description

no description available, TAbstractHashSet description follows
no description available, TContainer description follows

Hierarchy

Overview

Internal Types

Published THashItem = function (const Item: _TItem_) : Integer of object;
Published TItemEquals = function (const A, B: _TItem_) : Boolean of object;
Published TItemToString = function (const Item: _TItem_) : String of object;

Methods

Public procedure Clear;
Public function Contains(const Item: _TItem_) : Boolean;
Public constructor Create(InitialCapacity: Integer = 16);
Public constructor Create(LoadFact: Real);
Public constructor Create(InitialCapacity: Integer; LoadFact: Real);
Public function DefaultItemsEqual(const A, B: _TItem_) : Boolean; virtual;
Public function DefaultItemToString(const Item: _TItem_) : String; virtual;
Public function DefaultHashItem(const Item: _TItem_) : Integer; virtual;
Public procedure Delete(const Item: _TItem_);
Public procedure DeleteAt(const Position: THashSetCursor);
Public destructor Destroy; override;
Public procedure Difference(Left, Right: TGenHashSet);
Public procedure Exclude(const Item: _TItem_);
Public procedure ExcludeAll(ASet: TGenHashSet);
Public function First: THashSetCursor;
Public function GetEnumerator : TEnumerator;
Public function GetItemAt(const Position: THashSetCursor): _TItem_;
Public procedure Include(const Item: _TItem_);
Public procedure IncludeAll(ASet: TGenHashSet);
Public procedure Insert(const Item: _TItem_);
Public procedure Insert(const Item: _TItem_; out Inserted: Boolean);
Public procedure Intersection(Left, Right: TGenHashSet);
Public function IsEmpty: Boolean; inline;
Public function IsSubset(OfSet: TGenHashSet) : Boolean;
Public function Overlaps(ASet: TGenHashSet) : Boolean;
Public procedure ReadItemAt(const Position: THashSetCursor; out Value: _TItem_);
Public procedure SymmetricDifference(Left, Right: TGenHashSet);
Public function ToString : String; override;
Public procedure Union(Left, Right: TGenHashSet);

Properties

Public property Items[constPosition:THashSetCursor]: _TItem_ read GetItemAt;
Public property NilCursor: THashSetCursor read fNilCursor;
Public property OnItemsEqual : TItemEquals read GetOnItemsEqual write SetOnItemsEqual;
Public property OnItemToString : TItemToString read GetItemToString write SetOnItemToString;
Public property OnHashItem : THashItem read GetOnHashItem write SetOnHashItem;
Public property Size : Integer read GetSize;

Description

Internal Types

Published THashItem = function (const Item: _TItem_) : Integer of object;
 
Published TItemEquals = function (const A, B: _TItem_) : Boolean of object;
 
Published TItemToString = function (const Item: _TItem_) : String of object;
 

Methods

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 constructor Create(InitialCapacity: Integer = 16);

Creates an empty hash set and sets his capacity to InitialCapacity.

Public constructor Create(LoadFact: Real);

Creates an empty hash set and sets his load factor to LoadFact.

Public constructor Create(InitialCapacity: Integer; LoadFact: Real);

Creates an empty hash set and sets his capacity to InitialCapacity and his load factor to LoadFact.

Public function DefaultItemsEqual(const A, B: _TItem_) : Boolean; virtual;
 
Public function DefaultItemToString(const Item: _TItem_) : String; virtual;
 
Public function DefaultHashItem(const Item: _TItem_) : Integer; virtual;
 
Public procedure Delete(const Item: _TItem_);

Checks if Item is present in the container. If a match is found, removes the element from the set. Otherwise, raises an exception.

Public procedure DeleteAt(const Position: THashSetCursor);

Deletes the item designated by Position.

Public destructor Destroy; override;
 
Public procedure Difference(Left, Right: TGenHashSet);

Clears Self and then adds to Self all the items of Left that are not present in Right.

Public procedure Exclude(const Item: _TItem_);

Checks if Item is present in the container. If a match is found, removes the item from the set.

Public procedure ExcludeAll(ASet: TGenHashSet);

Excludes all the items of ASet.

Public function First: THashSetCursor;

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

Public function GetEnumerator : TEnumerator;
 
Public function GetItemAt(const Position: THashSetCursor): _TItem_;
 
Public procedure Include(const Item: _TItem_);

Checks if Item is present in the container. If no match is found, inserts the item into the set.

Public procedure IncludeAll(ASet: TGenHashSet);

Includes all the items of ASet.

Public procedure Insert(const Item: _TItem_);

Checks if Item is present in the container. If no match is found, inserts the item into the set. Otherwise, raises an exception.

Public procedure Insert(const Item: _TItem_; out Inserted: Boolean);

Checks if Item is present in the container. If no match is found, inserts the item into the set and sets Inserted to true. Otherwise, sets Inserted to false.

Public procedure Intersection(Left, Right: TGenHashSet);

Clears Self and then adds to Self all the items of Left that are present in Right.

Public function IsEmpty: Boolean; inline;

Returns true if the container is empty.

Public function IsSubset(OfSet: TGenHashSet) : Boolean;

Returns true if all the items in Self are present in OfSet.

Public function Overlaps(ASet: TGenHashSet) : Boolean;

Returns true if at least one item of Self is present in ASet.

Public procedure ReadItemAt(const Position: THashSetCursor; out Value: _TItem_);
 
Public procedure SymmetricDifference(Left, Right: TGenHashSet);

Clears Self and then adds to Self all the items of Left that are not present in Right all the items of Right that are not present in Left.

Public function ToString : String; override;

Return a string representation for the container.

Public procedure Union(Left, Right: TGenHashSet);

Clears Self and then adds to Self all the items of Left and all the items of Right.

Properties

Public property Items[constPosition:THashSetCursor]: _TItem_ read GetItemAt;

Provides access to the items in the container.

Public property NilCursor: THashSetCursor read fNilCursor;

A nil cursor.

Public property OnItemsEqual : TItemEquals read GetOnItemsEqual write SetOnItemsEqual;
 
Public property OnItemToString : TItemToString read GetItemToString write SetOnItemToString;
 
Public property OnHashItem : THashItem read GetOnHashItem write SetOnHashItem;
 
Public property Size : Integer read GetSize;
 

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