Class SymmetricRelation<T>
Describes a symmetric relation between values: a set of two-element sets.
Inheritance
System.Object
SymmetricRelation<T>
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Flame.Collections
Assembly: Flame.dll
Syntax
public sealed class SymmetricRelation<T>
Type Parameters
Name | Description |
---|---|
T | The type of values in the relation. |
Constructors
| Improve this Doc View SourceSymmetricRelation()
Creates an empty symmetric relation.
Declaration
public SymmetricRelation()
SymmetricRelation(IEqualityComparer<T>)
Creates an empty symmetric relation.
Declaration
public SymmetricRelation(IEqualityComparer<T> comparer)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEqualityComparer<T> | comparer | The equality comparer to use. |
Methods
| Improve this Doc View SourceAdd(T, T)
Adds a pair of values to the relation.
Declaration
public bool Add(T first, T second)
Parameters
Type | Name | Description |
---|---|---|
T | first | The first element to relate. |
T | second | The second element to relate. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Contains(T, T)
Tests if two elements are related.
Declaration
public bool Contains(T first, T second)
Parameters
Type | Name | Description |
---|---|---|
T | first | A first element. |
T | second | A second element. |
Returns
Type | Description |
---|---|
System.Boolean |
|
GetAll(T)
Gets the set of all values related to a particular value.
Declaration
public IEnumerable<T> GetAll(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | The value to examine. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<T> | The set of all related values. |
Remove(T, T)
Removes a pair of values from the relation.
Declaration
public bool Remove(T first, T second)
Parameters
Type | Name | Description |
---|---|---|
T | first | A first element. |
T | second | A second element. |
Returns
Type | Description |
---|---|
System.Boolean |
|