| Class DInternalHash (unit SDL) |
| Constructors |
constructor Create;
constructor CreateFrom(another : DInternalHash);
constructor CreateWith(compare : DComparator);| Functions |
function allowsDuplicates : Boolean;
destructor Destroy;
function finish : DIterator;
function maxSize : Integer;
procedure removeAt(iterator : DIterator);
procedure removeIn(_start, _finish : DIterator);
procedure SetBucketClass(cls : DSequenceClass);
procedure SetBucketCount(bCount : Integer);
function size : Integer;
function start : DIterator;
function startKey : DIterator;
procedure _add(const obj : DObject);
function _count(const key : DObject) : Integer;
function _countValues(const value : DObject) : Integer;
function _getAt(const key : DObject) : DObject;
function _locate(const key : DObject) : DIterator;
procedure _putAt(const key, value : DObject);
procedure _remove(const key : DObject);
procedure _removeN(const key : DObject; count : Integer);
procedure _removeValueN(const value : DObject; count : Integer);| Properties |
| Events |
| Variables |
| Constructors |
constructor Create;
constructor CreateFrom(another : DInternalHash);
constructor CreateWith(compare : DComparator);| Functions |
function allowsDuplicates : Boolean;Determine if this map permits duplicates.
destructor Destroy;
function finish : DIterator;Returns an iterator positioned after the last item.
function maxSize : Integer;Returns the absolute maximum number of items this hash map can hold.
procedure removeAt(iterator : DIterator);Removes the pair the iterator is pointing to.
procedure removeIn(_start, _finish : DIterator);Removes all pairs from start to finish.
procedure SetBucketClass(cls : DSequenceClass);| Parameter | Description |
|---|---|
| cls | The DSequence-derived class to use to store items that collide on hash entries. Arrays are the tightested, but don't have good deletion characteristics. Lists delete better, but take up more space and iterate more slowly. |
Choose a different class for the hash buckets. Supported classes are DSequence derivatives. It is an error to call this function if the container is not empty.
procedure SetBucketCount(bCount : Integer);| Parameter | Description |
|---|---|
| bCount | The number of buckets to use. Using more buckets usually reduces search time, but chews up more memory. You need to decide on an appropriate tradeoff. The default is 128. |
Choose the number of buckets to be used. It is an error to call this if the container is not empty.
function size : Integer;Returns the number of pairs in this hash map.
function start : DIterator;Returns an iterator positioned at the first pair in the hash map.
function startKey : DIterator;Returns a key oriented iterator positioned at the first pair.
procedure _add(const obj : DObject);Adds an object to this hash map.
function _count(const key : DObject) : Integer;Return the number of pairs with keys equal to the specified key.
function _countValues(const value : DObject) : Integer;Return the number of pairs with values equal to the specified value.
function _getAt(const key : DObject) : DObject;Retrieve the value for a specified key. The key must exist in the map.
function _locate(const key : DObject) : DIterator;Returns an iterator positioned at the pair with the specified key. If the key is not found, the iterator is positioned at the end.
procedure _putAt(const key, value : DObject);Add the specified key, value pair to the map. Copies are made of the objects.
procedure _remove(const key : DObject);Removes the all pairs with the specified key.
procedure _removeN(const key : DObject; count : Integer);Removes the first count pairs with the specified key.
procedure _removeValueN(const value : DObject; count : Integer);Removes the first pair with the specified value.
| Properties |
| Events |
| Variables |