Sign in Join
FPDoc Onlineexperiment

TFPCustomHashTable class

In unit Contnrs

Hash class.

Declaration

pascal
TFPCustomHashTable = class(TObject)

Inheritance

  1. TFPCustomHashTable
  2. TObject

Descends from it: TFPDataHashTable TFPObjectHashTable TFPStringHashTable TLazFPGHashTable

Description

TFPCustomHashTable is a general-purpose hashing class. It can store string keys and pointers associated with these strings. The hash mechanism is configurable and can be optionally be specified when a new instance of the class is created; A default hash mechanism is implemented in RSHash.

The TFPHashList can also be used when fast lookup of data based on some key is required. It is slightly faster than the TFPCustomHashTable implementation, but the keys are limited to a length of 256 characters, and it is not suitable for re-use: it is a one-time fill, many times search object. TFPCustomHashTable is slower, but handles re-use better.

See also

Properties

HashFunctionpublicHash function currently in use.
CountpublicNumber of items in the hash table.
HashTableSizepublicSize of the hash table.
HashTablepublicHash table instance.
VoidSlotspublicNumber of empty slots in the hash table.
LoadFactorpublicFraction of count versus size.
AVGChainLenpublicAverage chain length.
MaxChainLengthpublicMaximum chain length.
NumberOfCollisionspublicNumber of extra items.
DensitypublicNumber of filled slots.

Methods

Chainprotected
CreateNewNodeprotected
AddNodeprotected
ChainLengthprotected
FindOrCreateNewprotected
SetHashFunctionprotected
FindChainForAddprotected
CreatepublicInstantiate a new TFPCustomHashTable instance using the default hash mechanism.
CreateWithpublicInstantiate a new TFPCustomHashTable instance with given algorithm and size.
DestroypublicFree the hash table.
ChangeTableSizepublicChange the table size of the hash table.
ClearpublicClear the hash table.
DeletepublicDelete a key from the hash list.
FindpublicSearch for an item with a certain key value.
IsEmptypublicCheck if the hash table is empty.

Fields

FHashTableSizeprotected

Inherited

From TObject (40)

AfterConstruction BeforeDestruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName SafeCallException StringMessageTable SystemHasExtendedRTTI ToString UnitName

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.