Show / Hide Table of Contents

    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 Source

    SymmetricRelation()

    Creates an empty symmetric relation.

    Declaration
    public SymmetricRelation()
    | Improve this Doc View Source

    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 Source

    Add(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

    true if first and second are not related yet; otherwise, false.

    | Improve this Doc View Source

    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

    true if the elements are related under this relation; otherwise, false.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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

    true if first and second were related; otherwise, false.

    • Improve this Doc
    • View Source
    Back to top Generated by DocFX