Class IntSet
Immutable set of integers.
Implements
Inherited Members
Namespace: Automata.Core
Assembly: Automata.Core.dll
Syntax
public class IntSet : IEquatable<IntSet>, IReadOnlySet<int>, IReadOnlyCollection<int>, IEnumerable<int>, IEnumerable
Constructors
| Edit this page View SourceIntSet(IEnumerable<int>)
Initializes a new instance of the IntSet class with the specified elements.
Declaration
public IntSet(IEnumerable<int> elements)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<int> | elements | Elements to include in the set. |
Properties
| Edit this page View SourceCount
Number of elements in the set.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
int |
Methods
| Edit this page View SourceContains(int)
Indicates whether the current set contains the specified item.
Declaration
public bool Contains(int item)
Parameters
Type | Name | Description |
---|---|---|
int | item | Item to locate in the set. |
Returns
Type | Description |
---|---|
bool | true
|
Equals(IntSet?)
Indicates whether the current set is equal to another set.
Declaration
public bool Equals(IntSet? other)
Parameters
Type | Name | Description |
---|---|---|
IntSet | other | Other set to compare to. |
Returns
Type | Description |
---|---|
bool | true
|
Equals(object?)
Indicates whether the current set is equal to another object.
Declaration
public override bool Equals(object? obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | Object to compare to. |
Returns
Type | Description |
---|---|
bool |
Overrides
| Edit this page View SourceGetEnumerator()
Returns an enumerator that iterates through the set.
Declaration
public IEnumerator<int> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<int> | An enumerator for the set. |
GetHashCode()
Hash code for the current set.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | The hash code for the current set. |
Overrides
| Edit this page View SourceIsProperSubsetOf(IEnumerable<int>)
Indicates whether the current set is a proper subset of the specified collection.
Declaration
public bool IsProperSubsetOf(IEnumerable<int> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<int> | other | Collection to compare to. |
Returns
Type | Description |
---|---|
bool | true
|
IsProperSupersetOf(IEnumerable<int>)
Indicates whether the current set is a proper superset of the specified collection.
Declaration
public bool IsProperSupersetOf(IEnumerable<int> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<int> | other | Collection to compare to. |
Returns
Type | Description |
---|---|
bool | true
|
IsSubsetOf(IEnumerable<int>)
Indicates whether the current set is a subset of the specified collection.
Declaration
public bool IsSubsetOf(IEnumerable<int> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<int> | other | Collection to compare to. |
Returns
Type | Description |
---|---|
bool | true
|
IsSupersetOf(IEnumerable<int>)
Indicates whether the current set is a superset of the specified collection.
Declaration
public bool IsSupersetOf(IEnumerable<int> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<int> | other | Collection to compare to. |
Returns
Type | Description |
---|---|
bool | true
|
Overlaps(IEnumerable<int>)
Indicates whether the current set overlaps with the specified collection.
Declaration
public bool Overlaps(IEnumerable<int> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<int> | other | Collection to compare to. |
Returns
Type | Description |
---|---|
bool | true
|
SetEquals(IEnumerable<int>)
Indicates whether the current set is equal to the specified collection.
Declaration
public bool SetEquals(IEnumerable<int> other)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<int> | other | Collection to compare to. |
Returns
Type | Description |
---|---|
bool | true
|
ToString()
String that represents the current set.
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | A string that represents the current set. |
Overrides
Operators
| Edit this page View Sourceoperator ==(IntSet, IntSet)
Equality operator.
Declaration
public static bool operator ==(IntSet left, IntSet right)
Parameters
Type | Name | Description |
---|---|---|
IntSet | left | Left operand. |
IntSet | right | Right operand. |
Returns
Type | Description |
---|---|
bool | true
|
operator !=(IntSet, IntSet)
Inequality operator.
Declaration
public static bool operator !=(IntSet left, IntSet right)
Parameters
Type | Name | Description |
---|---|---|
IntSet | left | Left operand. |
IntSet | right | Right operand. |
Returns
Type | Description |
---|---|
bool | true
|