Class TgoReadOnlySet
Unit
Grijjy.Collections
Declaration
type TgoReadOnlySet<T> = class(TEnumerable<T>)
Description
Generic read-only set. Provides a read-only view of a TgoSet<T>
Hierarchy
- TEnumerable
- TgoReadOnlySet
Overview
Methods
|
function ToArray: TArray<T>; override; final; |
|
function DoGetEnumerator: TEnumerator<T>; override; |
|
constructor Create; overload; |
|
constructor Create(const AComparer: IEqualityComparer<T>); overload; |
|
function Contains(const AItem: T): Boolean; |
Properties
|
property Count: Integer read FCount; |
Description
Methods
|
function ToArray: TArray<T>; override; final; |
Copies the items in the set to a dynamic array
|
|
function DoGetEnumerator: TEnumerator<T>; override; |
Allow for..in enumeration of the items in the set.
|
|
constructor Create; overload; |
Creates a read-only set using a default comparer.
|
|
constructor Create(const AComparer: IEqualityComparer<T>); overload; |
Creates a read-only set using a custom comparer.
Parameters
- AComparer
- the comparer to use to check for item equality. Pass nil to use the default comparer.
|
|
function Contains(const AItem: T): Boolean; |
Checks if the set contains a given item. This is an O(1) operation that uses the set's comparer to check for equality.
Parameters
- AItem
- the item to check.
Returns
True if the set contains AItem, False if not. |
Properties
|
property Count: Integer read FCount; |
The number of items in the set
|
Generated by P2PasDoc 0.13.0 on 2017-04-25 12:54:26
|