Show / Hide Table of Contents

    Class MappedComparer<T1, T2>

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

    Inheritance
    System.Object
    MappedComparer<T1, T2>
    Implements
    System.Collections.Generic.IEqualityComparer<T1>
    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 MappedComparer<T1, T2> : IEqualityComparer<T1>
    Type Parameters
    Name Description
    T1

    The argument type of the mapping.

    T2

    The return type of the mapping.

    Constructors

    | Improve this Doc 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
    System.Func<T1, T2> transform

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

    | Improve this Doc 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
    System.Func<T1, T2> transform

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

    System.Collections.Generic.IEqualityComparer<T2> resultComparer

    A comparer for the results of transform.

    Fields

    | Improve this Doc View Source

    ResultComparer

    An equality comparer for values of type T2.

    Declaration
    public readonly IEqualityComparer<T2> ResultComparer
    Field Value
    Type Description
    System.Collections.Generic.IEqualityComparer<T2>
    | Improve this Doc 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
    System.Func<T1, T2>

    Methods

    | Improve this Doc 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
    System.Boolean
    | Improve this Doc 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
    System.Int32

    A hash code.

    Implements

    System.Collections.Generic.IEqualityComparer<T>
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX