Search Results for

    Show / Hide Table of Contents

    Class MappedComparer<T1, T2>

    An equality comparer that applies a mapping to elements before comparing them.

    Inheritance
    object
    MappedComparer<T1, T2>
    Implements
    IEqualityComparer<T1>
    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 MappedComparer<T1, T2> : IEqualityComparer<T1>
    Type Parameters
    Name Description
    T1

    The argument type of the mapping.

    T2

    The return type of the mapping.

    Constructors

    | Edit this page View Source

    MappedComparer(Func<T1, T2>)

    Creates an equality comparer that first applies a mapping and then compares the results using the default comparer.

    Declaration
    public MappedComparer(Func<T1, T2> transform)
    Parameters
    Type Name Description
    Func<T1, T2> transform

    A mapping that takes an element and transforms it before it is compared.

    | Edit this page View Source

    MappedComparer(Func<T1, T2>, IEqualityComparer<T2>)

    Creates an equality comparer that first applies a mapping and then compares the results using a custom comparer.

    Declaration
    public MappedComparer(Func<T1, T2> transform, IEqualityComparer<T2> resultComparer)
    Parameters
    Type Name Description
    Func<T1, T2> transform

    A mapping that takes an element and transforms it before it is compared.

    IEqualityComparer<T2> resultComparer

    A comparer for the results of transform.

    Fields

    | Edit this page View Source

    ResultComparer

    An equality comparer for values of type T2.

    Declaration
    public readonly IEqualityComparer<T2> ResultComparer
    Field Value
    Type Description
    IEqualityComparer<T2>
    | Edit this page View Source

    Transform

    Takes a value of type T1 and maps it to a value of type T2.

    Declaration
    public readonly Func<T1, T2> Transform
    Field Value
    Type Description
    Func<T1, T2>

    Methods

    | Edit this page View Source

    Equals(T1, T1)

    Tests if two values are equal.

    Declaration
    public bool Equals(T1 x, T1 y)
    Parameters
    Type Name Description
    T1 x

    The first value to compare.

    T1 y

    The second value to compare.

    Returns
    Type Description
    bool
    | Edit this page View Source

    GetHashCode(T1)

    Computes a hash code for a value.

    Declaration
    public int GetHashCode(T1 obj)
    Parameters
    Type Name Description
    T1 obj

    The value to compute a hash code for.

    Returns
    Type Description
    int

    A hash code.

    Implements

    IEqualityComparer<T>
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX