Class TgoSet

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type TgoSet<T> = class(TgoReadOnlySet<T>)

Description

A generic unordered set of values. Is similar to TList<T> in that it contains a list of items, but the items are not in any specific order. It uses a hash table to quickly lookup items in the set.

This class is also similar to TDictionary<TKey, TValue>, but with only keys and no values.

This class is typically used when you need to quickly find items in a collection, but don't need any specific ordering.

See also TgoObjectSet<T> for a set that owns its items

Hierarchy

Overview

Methods

Public procedure Add(const AItem: T);
Public procedure AddOrSet(const AItem: T);
Public procedure Remove(const AItem: T);
Public procedure Clear; virtual;

Description

Methods

Public procedure Add(const AItem: T);

Adds an item to the set, raising an exception if the set already contains the item.

Parameters
AItem
the item to add.
Public procedure AddOrSet(const AItem: T);

Adds an item to the set if it doesn't exist yet. If the set already contains the item, then nothing happens.

Parameters
AItem
the item to add.
Public procedure Remove(const AItem: T);

Removes an item from the set. Does nothing if the set does not contain the item.

Parameters
AItem
the item to remove.
Public procedure Clear; virtual;

Clears the set.


Generated by P2PasDoc 0.13.0 on 2017-04-25 12:54:26