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
- Reference: Island.fx
- Namespace: RemObjects.Elements.System
constructor
Creates a hashset
constructor
HashSet<T>()
init()
HashSet<T>()
constructor (IEqualityComparer<T>)
Creates a hashset
constructor(aComparer: IEqualityComparer<T>)
HashSet<T>(IEqualityComparer<T> aComparer)
init(_ aComparer: IEqualityComparer<T>)
HashSet<T>(IEqualityComparer<T> aComparer)
Parameters:
- aComparer: The comparison implementation used to check if values are equal
constructor (Int32)
Creates a hashset
constructor(aCapacity: Int32)
HashSet<T>(Int32 aCapacity)
init(_ aCapacity: Int32)
HashSet<T>(Int32 aCapacity)
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>)
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)
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.
Parameters:
- Item: The item to add
Clear
Clear this hashset.
method Clear
void Clear()
func Clear()
void 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; }
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)
Parameters:
- Item: the item to check
Count
Returns the nr of items in this hashset
Equals virtual (declared in Object)
Returns true if the target object matches this one, by default compares the reference.
Parameters:
- obj: the reference to compare this with.
Finalize protected virtual (declared in Object)
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
void Finalize()
func Finalize()
void Finalize()
ForEach
Iterates this hashset, triggering a delegate for every item
method ForEach(Action: Action<T>)
void ForEach(Action<T> Action)
func ForEach(_ Action: 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.
GetSequence
Returns a sequence with all items in this hashset
method GetSequence: IEnumerable<T>
IEnumerable<T> GetSequence()
func GetSequence() -> IEnumerable<T>
IEnumerable<T> GetSequence()
GetType (declared in Object)
Returns the actual type of this class
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; }
ReferenceEquals (declared in Object)
Compares two references for equivalence (even if they have an equals operator)
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)
Parameters:
- Item: The item to remove
ToString virtual (declared in Object)
Gets the string representation of this method.
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; }
Count
Returns the nr of items in this hashset
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; }
ReferenceEquals (declared in Object)
Compares two references for equivalence (even if they have an equals operator)
Parameters:
- a: left value
- b: right value
constructor
Creates a hashset
constructor
HashSet<T>()
init()
HashSet<T>()
constructor (IEqualityComparer<T>)
Creates a hashset
constructor(aComparer: IEqualityComparer<T>)
HashSet<T>(IEqualityComparer<T> aComparer)
init(_ aComparer: IEqualityComparer<T>)
HashSet<T>(IEqualityComparer<T> aComparer)
Parameters:
- aComparer: The comparison implementation used to check if values are equal
constructor (Int32)
Creates a hashset
constructor(aCapacity: Int32)
HashSet<T>(Int32 aCapacity)
init(_ aCapacity: Int32)
HashSet<T>(Int32 aCapacity)
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>)
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)
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.
Parameters:
- Item: The item to add
Clear
Clear this hashset.
method Clear
void Clear()
func Clear()
void 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)
Parameters:
- Item: the item to check
Equals virtual (declared in Object)
Returns true if the target object matches this one, by default compares the reference.
Parameters:
- obj: the reference to compare this with.
Finalize protected virtual (declared in Object)
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
void Finalize()
func Finalize()
void Finalize()
ForEach
Iterates this hashset, triggering a delegate for every item
method ForEach(Action: Action<T>)
void ForEach(Action<T> Action)
func ForEach(_ Action: 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.
GetSequence
Returns a sequence with all items in this hashset
method GetSequence: IEnumerable<T>
IEnumerable<T> GetSequence()
func GetSequence() -> IEnumerable<T>
IEnumerable<T> GetSequence()
GetType (declared in Object)
Returns the actual type of this class
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)
Parameters:
- Item: The item to remove
ToString virtual (declared in Object)
Gets the string representation of this method.