Class TgoSet
Unit
Grijjy.Collections
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
|
procedure Add(const AItem: T); |
|
procedure AddOrSet(const AItem: T); |
|
procedure Remove(const AItem: T); |
|
procedure Clear; virtual; |
Description
Methods
|
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 .
|
|
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.
|
|
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 .
|
|
procedure Clear; virtual; |
Clears the set.
|
Generated by P2PasDoc 0.13.0 on 2017-04-25 12:54:26
|