HashSet<T>

Overview

Hashset implementation for Island; A hashset is a set of (unique) items that has methods to enumerate and check if the set contains a value.

Location

 

constructor UIKit for Mac

Creates a hashset

 

constructor

 

HashSet<T>()

 

init()

 

HashSet<T>()

 

Sub New()

constructor (Int32) Android, iOS, iOS Simulator, Mac Catalyst, macOS, tvOS, tvOS Simulator, Ubuntu, watchOS, watchOS Simulator, WebAssembly, Windows

 

constructor(aCapacity: Int32)

 

HashSet<T>(Int32 aCapacity)

 

init(_ aCapacity: Int32)

 

HashSet<T>(Int32 aCapacity)

 

Sub New(aCapacity As Int32)

Parameters:

  • aCapacity:

constructor (Int32, IEqualityComparer<T>) Android, iOS, iOS Simulator, Mac Catalyst, macOS, tvOS, tvOS Simulator, Ubuntu, watchOS, watchOS Simulator, WebAssembly, Windows

 

constructor(aCapacity: Int32; aComparer: IEqualityComparer<T>)

 

HashSet<T>(Int32 aCapacity, IEqualityComparer<T> aComparer)

 

init(_ aCapacity: Int32, _ aComparer: IEqualityComparer<T>)

 

HashSet<T>(Int32 aCapacity, IEqualityComparer<T> aComparer)

 

Sub New(aCapacity As Int32, aComparer As IEqualityComparer<T>)

Parameters:

  • aCapacity:
  • aComparer:

constructor (IEqualityComparer<T>) Android, iOS, iOS Simulator, Mac Catalyst, macOS, tvOS, tvOS Simulator, Ubuntu, watchOS, watchOS Simulator, WebAssembly, Windows

 

constructor(aComparer: IEqualityComparer<T>)

 

HashSet<T>(IEqualityComparer<T> aComparer)

 

init(_ aComparer: IEqualityComparer<T>)

 

HashSet<T>(IEqualityComparer<T> aComparer)

 

Sub New(aComparer As IEqualityComparer<T>)

Parameters:

  • aComparer:

constructor (IEqualityComparer<T>) UIKit for Mac

Creates a hashset

 

constructor(aComparer: IEqualityComparer<T>)

 

HashSet<T>(IEqualityComparer<T> aComparer)

 

init(_ aComparer: IEqualityComparer<T>)

 

HashSet<T>(IEqualityComparer<T> aComparer)

 

Sub New(aComparer As IEqualityComparer<T>)

Parameters:

  • aComparer: The comparison implementation used to check if values are equal

constructor (Int32) UIKit for Mac

Creates a hashset

 

constructor(aCapacity: Int32)

 

HashSet<T>(Int32 aCapacity)

 

init(_ aCapacity: Int32)

 

HashSet<T>(Int32 aCapacity)

 

Sub New(aCapacity As Int32)

Parameters:

  • aCapacity: The initial number of items supported by this hashset. While the set will grow if needed, this is the nr of items initially allocated.

constructor (Int32, IEqualityComparer<T>) UIKit for Mac

Creates a hashset

 

constructor(aCapacity: Int32; aComparer: IEqualityComparer<T>)

 

HashSet<T>(Int32 aCapacity, IEqualityComparer<T> aComparer)

 

init(_ aCapacity: Int32, _ aComparer: IEqualityComparer<T>)

 

HashSet<T>(Int32 aCapacity, IEqualityComparer<T> aComparer)

 

Sub New(aCapacity As Int32, aComparer As IEqualityComparer<T>)

Parameters:

  • aCapacity: The initial number of items supported by this hashset. While the set will grow if needed, this is the nr of items initially allocated.
  • aComparer: The comparison implementation used to check if values are equal

Add

Add a new item to the hashset. Returns true if succesful, false if it already exists.

 

method Add(Item: T): Boolean

 

Boolean Add(T Item)

 

func Add(_ Item: T) -> Boolean

 

Boolean Add(T Item)

 

Function Add(Item As T) As Boolean

Parameters:

  • Item: The item to add

Clear UIKit for Mac

Clear this hashset.

 

method Clear

 

Clear()

 

func Clear()

 

Clear()

 

Sub Clear()

Comparer

Returns the comparer used to create this hashset.

 

property Comparer: IEqualityComparer<T> read;

 

IEqualityComparer<T> Comparer { get; }

 

var Comparer: IEqualityComparer<T> { get{} }

 

IEqualityComparer<T> Comparer { __get; }

 

ReadOnly Property Comparer() As IEqualityComparer<T>

Contains

Check if the hashset contains this item

 

method Contains(Item: T): Boolean

 

Boolean Contains(T Item)

 

func Contains(_ Item: T) -> Boolean

 

Boolean Contains(T Item)

 

Function Contains(Item As T) As Boolean

Parameters:

  • Item: the item to check

Count

Returns the nr of items in this hashset

 

property Count: Int32 read;

 

Int32 Count { get; }

 

var Count: Int32 { get{} }

 

Int32 Count { __get; }

 

ReadOnly Property Count() As Int32

Equals (Object): Boolean  virtual    (declared in Object) Android, iOS, iOS Simulator, Mac Catalyst, macOS, tvOS, tvOS Simulator, Ubuntu, watchOS, watchOS Simulator, WebAssembly, Windows

 

method Equals(aOther: Object): Boolean

 

Boolean Equals(Object aOther)

 

func Equals(_ aOther: Object) -> Boolean

 

Boolean Equals(Object aOther)

 

Function Equals(aOther As Object) As Boolean

Parameters:

  • aOther:

Equals (Object): Boolean  virtual    (declared in Object) UIKit for Mac

Returns true if the target object matches this one, by default compares the reference.

 

method Equals(obj: Object): Boolean

 

Boolean Equals(Object obj)

 

func Equals(_ obj: Object) -> Boolean

 

Boolean Equals(Object obj)

 

Function Equals(obj As Object) As Boolean

Parameters:

  • obj: the reference to compare this with.

Finalize  protected virtual    (declared in Object) UIKit for Mac

Finalizer implementation. If not overriden it's not called at all, the runtime checks if there is an override before calling a finalizer.

 

method Finalize

 

Finalize()

 

func Finalize()

 

Finalize()

 

Sub Finalize()

ForEach (Action<T>) Android, iOS, iOS Simulator, Mac Catalyst, macOS, tvOS, tvOS Simulator, Ubuntu, watchOS, watchOS Simulator, WebAssembly, Windows

 

method ForEach(Action: Action<T>)

 

void ForEach(Action<T> Action)

 

func ForEach(_ Action: Action<T>)

 

void ForEach(Action<T> Action)

 

Sub ForEach(Action As Action<T>)

Parameters:

  • Action:

ForEach (Action<T>) UIKit for Mac

Iterates this hashset, triggering a delegate for every item

 

method ForEach(Action: Action<T>)

 

ForEach(Action<T> Action)

 

func ForEach(_ Action: Action<T>)

 

ForEach(Action<T> Action)

 

Sub ForEach(Action As Action<T>)

Parameters:

  • Action: The delegate to trigger

GetHashCode  virtual    (declared in Object)

Returns a hashcode for this object. Overriden implementations should make sure that the number returned here is constant given the same object.

 

method GetHashCode: Int32

 

Int32 GetHashCode()

 

func GetHashCode() -> Int32

 

Int32 GetHashCode()

 

Function GetHashCode() As Int32

GetSequence

Returns a sequence with all items in this hashset

 

method GetSequence: IEnumerable<T>

 

IEnumerable<T> GetSequence()

 

func GetSequence() -> IEnumerable<T>

 

IEnumerable<T> GetSequence()

 

Function GetSequence() As IEnumerable<T>

GetType    (declared in Object)

Returns the actual type of this class

 

method GetType: Type

 

Type GetType()

 

func GetType() -> Type

 

Type GetType()

 

Function GetType() As Type

Items

Returns a sequence with all items in this hashset

 

property Items: IEnumerable<T> read;

 

IEnumerable<T> Items { get; }

 

var Items: IEnumerable<T> { get{} }

 

IEnumerable<T> Items { __get; }

 

ReadOnly Property Items() As IEnumerable<T>

ReferenceEquals    (declared in Object)

Compares two references for equivalence (even if they have an equals operator)

 

class method ReferenceEquals(a: Object; b: Object): Boolean

 

static Boolean ReferenceEquals(Object a, Object b)

 

static func ReferenceEquals(_ a: Object, _ b: Object) -> Boolean

 

static Boolean ReferenceEquals(Object a, Object b)

 

Shared Function ReferenceEquals(a As Object, b As Object) As Boolean

Parameters:

  • a: left value
  • b: right value

Remove

Removes an item from this hashset, returns true if succesful or false if it wasn't there

 

method Remove(Item: T): Boolean

 

Boolean Remove(T Item)

 

func Remove(_ Item: T) -> Boolean

 

Boolean Remove(T Item)

 

Function Remove(Item As T) As Boolean

Parameters:

  • Item: The item to remove

ToString  virtual    (declared in Object)

Gets the string representation of this method.

 

method ToString: String

 

String ToString()

 

func ToString() -> String

 

String ToString()

 

Function ToString() As String

 

Comparer

Returns the comparer used to create this hashset.

 

property Comparer: IEqualityComparer<T> read;

 

IEqualityComparer<T> Comparer { get; }

 

var Comparer: IEqualityComparer<T> { get{} }

 

IEqualityComparer<T> Comparer { __get; }

 

ReadOnly Property Comparer() As IEqualityComparer<T>

Count

Returns the nr of items in this hashset

 

property Count: Int32 read;

 

Int32 Count { get; }

 

var Count: Int32 { get{} }

 

Int32 Count { __get; }

 

ReadOnly Property Count() As Int32

Items

Returns a sequence with all items in this hashset

 

property Items: IEnumerable<T> read;

 

IEnumerable<T> Items { get; }

 

var Items: IEnumerable<T> { get{} }

 

IEnumerable<T> Items { __get; }

 

ReadOnly Property Items() As IEnumerable<T>

 

ReferenceEquals    (declared in Object)

Compares two references for equivalence (even if they have an equals operator)

 

class method ReferenceEquals(a: Object; b: Object): Boolean

 

static Boolean ReferenceEquals(Object a, Object b)

 

static func ReferenceEquals(_ a: Object, _ b: Object) -> Boolean

 

static Boolean ReferenceEquals(Object a, Object b)

 

Shared Function ReferenceEquals(a As Object, b As Object) As Boolean

Parameters:

  • a: left value
  • b: right value

 

constructor UIKit for Mac

Creates a hashset

 

constructor

 

HashSet<T>()

 

init()

 

HashSet<T>()

 

Sub New()

constructor (Int32) Android, iOS, iOS Simulator, Mac Catalyst, macOS, tvOS, tvOS Simulator, Ubuntu, watchOS, watchOS Simulator, WebAssembly, Windows

 

constructor(aCapacity: Int32)

 

HashSet<T>(Int32 aCapacity)

 

init(_ aCapacity: Int32)

 

HashSet<T>(Int32 aCapacity)

 

Sub New(aCapacity As Int32)

Parameters:

  • aCapacity:

constructor (Int32, IEqualityComparer<T>) Android, iOS, iOS Simulator, Mac Catalyst, macOS, tvOS, tvOS Simulator, Ubuntu, watchOS, watchOS Simulator, WebAssembly, Windows

 

constructor(aCapacity: Int32; aComparer: IEqualityComparer<T>)

 

HashSet<T>(Int32 aCapacity, IEqualityComparer<T> aComparer)

 

init(_ aCapacity: Int32, _ aComparer: IEqualityComparer<T>)

 

HashSet<T>(Int32 aCapacity, IEqualityComparer<T> aComparer)

 

Sub New(aCapacity As Int32, aComparer As IEqualityComparer<T>)

Parameters:

  • aCapacity:
  • aComparer:

constructor (IEqualityComparer<T>) Android, iOS, iOS Simulator, Mac Catalyst, macOS, tvOS, tvOS Simulator, Ubuntu, watchOS, watchOS Simulator, WebAssembly, Windows

 

constructor(aComparer: IEqualityComparer<T>)

 

HashSet<T>(IEqualityComparer<T> aComparer)

 

init(_ aComparer: IEqualityComparer<T>)

 

HashSet<T>(IEqualityComparer<T> aComparer)

 

Sub New(aComparer As IEqualityComparer<T>)

Parameters:

  • aComparer:

constructor (IEqualityComparer<T>) UIKit for Mac

Creates a hashset

 

constructor(aComparer: IEqualityComparer<T>)

 

HashSet<T>(IEqualityComparer<T> aComparer)

 

init(_ aComparer: IEqualityComparer<T>)

 

HashSet<T>(IEqualityComparer<T> aComparer)

 

Sub New(aComparer As IEqualityComparer<T>)

Parameters:

  • aComparer: The comparison implementation used to check if values are equal

constructor (Int32) UIKit for Mac

Creates a hashset

 

constructor(aCapacity: Int32)

 

HashSet<T>(Int32 aCapacity)

 

init(_ aCapacity: Int32)

 

HashSet<T>(Int32 aCapacity)

 

Sub New(aCapacity As Int32)

Parameters:

  • aCapacity: The initial number of items supported by this hashset. While the set will grow if needed, this is the nr of items initially allocated.

constructor (Int32, IEqualityComparer<T>) UIKit for Mac

Creates a hashset

 

constructor(aCapacity: Int32; aComparer: IEqualityComparer<T>)

 

HashSet<T>(Int32 aCapacity, IEqualityComparer<T> aComparer)

 

init(_ aCapacity: Int32, _ aComparer: IEqualityComparer<T>)

 

HashSet<T>(Int32 aCapacity, IEqualityComparer<T> aComparer)

 

Sub New(aCapacity As Int32, aComparer As IEqualityComparer<T>)

Parameters:

  • aCapacity: The initial number of items supported by this hashset. While the set will grow if needed, this is the nr of items initially allocated.
  • aComparer: The comparison implementation used to check if values are equal

Add

Add a new item to the hashset. Returns true if succesful, false if it already exists.

 

method Add(Item: T): Boolean

 

Boolean Add(T Item)

 

func Add(_ Item: T) -> Boolean

 

Boolean Add(T Item)

 

Function Add(Item As T) As Boolean

Parameters:

  • Item: The item to add

Clear UIKit for Mac

Clear this hashset.

 

method Clear

 

Clear()

 

func Clear()

 

Clear()

 

Sub Clear()

Contains

Check if the hashset contains this item

 

method Contains(Item: T): Boolean

 

Boolean Contains(T Item)

 

func Contains(_ Item: T) -> Boolean

 

Boolean Contains(T Item)

 

Function Contains(Item As T) As Boolean

Parameters:

  • Item: the item to check

Equals (Object): Boolean  virtual    (declared in Object) Android, iOS, iOS Simulator, Mac Catalyst, macOS, tvOS, tvOS Simulator, Ubuntu, watchOS, watchOS Simulator, WebAssembly, Windows

 

method Equals(aOther: Object): Boolean

 

Boolean Equals(Object aOther)

 

func Equals(_ aOther: Object) -> Boolean

 

Boolean Equals(Object aOther)

 

Function Equals(aOther As Object) As Boolean

Parameters:

  • aOther:

Equals (Object): Boolean  virtual    (declared in Object) UIKit for Mac

Returns true if the target object matches this one, by default compares the reference.

 

method Equals(obj: Object): Boolean

 

Boolean Equals(Object obj)

 

func Equals(_ obj: Object) -> Boolean

 

Boolean Equals(Object obj)

 

Function Equals(obj As Object) As Boolean

Parameters:

  • obj: the reference to compare this with.

Finalize  protected virtual    (declared in Object) UIKit for Mac

Finalizer implementation. If not overriden it's not called at all, the runtime checks if there is an override before calling a finalizer.

 

method Finalize

 

Finalize()

 

func Finalize()

 

Finalize()

 

Sub Finalize()

ForEach (Action<T>) Android, iOS, iOS Simulator, Mac Catalyst, macOS, tvOS, tvOS Simulator, Ubuntu, watchOS, watchOS Simulator, WebAssembly, Windows

 

method ForEach(Action: Action<T>)

 

void ForEach(Action<T> Action)

 

func ForEach(_ Action: Action<T>)

 

void ForEach(Action<T> Action)

 

Sub ForEach(Action As Action<T>)

Parameters:

  • Action:

ForEach (Action<T>) UIKit for Mac

Iterates this hashset, triggering a delegate for every item

 

method ForEach(Action: Action<T>)

 

ForEach(Action<T> Action)

 

func ForEach(_ Action: Action<T>)

 

ForEach(Action<T> Action)

 

Sub ForEach(Action As Action<T>)

Parameters:

  • Action: The delegate to trigger

GetHashCode  virtual    (declared in Object)

Returns a hashcode for this object. Overriden implementations should make sure that the number returned here is constant given the same object.

 

method GetHashCode: Int32

 

Int32 GetHashCode()

 

func GetHashCode() -> Int32

 

Int32 GetHashCode()

 

Function GetHashCode() As Int32

GetSequence

Returns a sequence with all items in this hashset

 

method GetSequence: IEnumerable<T>

 

IEnumerable<T> GetSequence()

 

func GetSequence() -> IEnumerable<T>

 

IEnumerable<T> GetSequence()

 

Function GetSequence() As IEnumerable<T>

GetType    (declared in Object)

Returns the actual type of this class

 

method GetType: Type

 

Type GetType()

 

func GetType() -> Type

 

Type GetType()

 

Function GetType() As Type

Remove

Removes an item from this hashset, returns true if succesful or false if it wasn't there

 

method Remove(Item: T): Boolean

 

Boolean Remove(T Item)

 

func Remove(_ Item: T) -> Boolean

 

Boolean Remove(T Item)

 

Function Remove(Item As T) As Boolean

Parameters:

  • Item: The item to remove

ToString  virtual    (declared in Object)

Gets the string representation of this method.

 

method ToString: String

 

String ToString()

 

func ToString() -> String

 

String ToString()

 

Function ToString() As String