Sign in Join
FPDoc Onlineexperiment

TCustomBucketList class

In unit Contnrs

Custom bucket list class.

Declaration

pascal
TCustomBucketList = class(TObject)

Inheritance

  1. TCustomBucketList
  2. TObject

Descends from it: TBucketList

Description

TCustomBucketList is an associative list using buckets for storage. It scales better than a regular TList list class, especially when an item must be searched in the list.

Since the list associates a data pointer with each item pointer, it follows that each item pointer must be unique, and can be added to the list only once.

The TCustomBucketList class does not determine the number of buckets or the bucket hash mechanism, this must be done by descendent classes such as TBucketList. TCustomBucketList only takes care of storage and retrieval of items in the various buckets.

Because TCustomBucketList is an abstract class - it does not determine the number of buckets - one should never instantiate an instance of TCustomBucketList, but always use a descendent class such as TCustomBucketList.

See also

Properties

Bucketsprotected
BucketCountprotected
DatapublicAssociative array for data pointers.

Methods

GetBucketItemprotected
AddItemprotected
BucketForprotected
DeleteItemprotected
Errorprotected
FindItemprotected
DestroypublicFrees the bucketlist from memory.
ClearpublicClear the list.
AddpublicAdd an item to the list.
AssignpublicAssign one bucket list to another.
ExistspublicCheck if an item exists in the list.
FindpublicFind an item in the list.
ForEachpublicLoop over all items.
RemovepublicRemove an item from the list.

Inherited

From TObject (41)

AfterConstruction BeforeDestruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance Create 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.