Search Results for

    Show / Hide Table of Contents

    Class SymmetricRelation<T>

    Describes a symmetric relation between values: a set of two-element sets.

    Inheritance
    object
    SymmetricRelation<T>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    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

    | Edit this page View Source

    SymmetricRelation()

    Creates an empty symmetric relation.

    Declaration
    public SymmetricRelation()
    | Edit this page View Source

    SymmetricRelation(IEqualityComparer<T>)

    Creates an empty symmetric relation.

    Declaration
    public SymmetricRelation(IEqualityComparer<T> comparer)
    Parameters
    Type Name Description
    IEqualityComparer<T> comparer

    The equality comparer to use.

    Methods

    | Edit this page 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
    bool

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

    | Edit this page 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
    bool

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

    | Edit this page 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
    IEnumerable<T>

    The set of all related values.

    | Edit this page 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
    bool

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

    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX