Skip to content

TFPObjectHashTable

Hash table for object instances.

Declaration

Source position: contnrs.pp line 494

type

  TFPObjectHashTable = class(TFPCustomHashTable)
  public
    constructor Create;
    constructor CreateWith;
    function Iterate(aMethod: TObjectIteratorMethod) : TObject;
    function Iterate(aMethod: TObjectIteratorCallback) : TObject;
    procedure Add;
    property Items[const  index : Ansistring]: TObject; {rw}
    property OwnsObjects: Boolean; {r}
  end;

Description

TFPStringHashTable is a TFPCustomHashTable descendent which stores object instances together with the keys. In case the data associated with the keys are strings themselves, it's better to use TFPStringHashTable, or for arbitrary pointer data, TFPDataHashTable is more suitable. The objects are exposed with their keys through the Items property.

Properties

Member Visibility Description
Items public Key-based access to the objects.
OwnsObjects read only public Does the hash table own the objects ?
See all Properties

Methods

Member Visibility Description
Add public Add a new object to the hash table.
Create public Create a new instance of TFPObjectHashTable.
CreateWith public Create a new hash table with given size and hash function.
Iterate public Iterate over the objects in the hash table.
See all Methods

See also

Name Description
TFPStringHashTable Hash table for string data.
TFPDataHashTable Hash table for data pointers.
TFPObjectHashTable.Items Key-based access to the objects.