Show / Hide Table of Contents

Class ArrayEqualityComparer<T>

An System.Collections.Generic.IEqualityComparer<T> implementation to compare two arrays of the same element type. This compares the elements in the order of the array.

The way to compare each element can be customized by specifying the ElementComparer.

Inheritance
System.Object
ArrayEqualityComparer<T>
Implements
System.Collections.Generic.IEqualityComparer<T[]>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Libplanet.Common
Assembly: Libplanet.Common.dll
Syntax
public class ArrayEqualityComparer<T> : IEqualityComparer<T[]> where T : IEquatable<T>
Type Parameters
Name Description
T

The element type of the array.

Constructors

| Improve this Doc View Source

ArrayEqualityComparer(IEqualityComparer<T>)

Creates a new instance of ArrayEqualityComparer<T>.

Declaration
public ArrayEqualityComparer(IEqualityComparer<T> elementComparer = null)
Parameters
Type Name Description
System.Collections.Generic.IEqualityComparer<T> elementComparer

Optionally customize the way to compare each element.

Properties

| Improve this Doc View Source

ElementComparer

Optionally customizes the way to compare each element.

Declaration
public IEqualityComparer<T> ElementComparer { get; }
Property Value
Type Description
System.Collections.Generic.IEqualityComparer<T>

Methods

| Improve this Doc View Source

Equals(T[], T[])

An System.Collections.Generic.IEqualityComparer<T> implementation to compare two arrays of the same element type. This compares the elements in the order of the array.

The way to compare each element can be customized by specifying the ElementComparer.

Declaration
public bool Equals(T[] x, T[] y)
Parameters
Type Name Description
T[] x
T[] y
Returns
Type Description
System.Boolean
| Improve this Doc View Source

GetHashCode(T[])

An System.Collections.Generic.IEqualityComparer<T> implementation to compare two arrays of the same element type. This compares the elements in the order of the array.

The way to compare each element can be customized by specifying the ElementComparer.

Declaration
public int GetHashCode(T[] obj)
Parameters
Type Name Description
T[] obj
Returns
Type Description
System.Int32

Implements

System.Collections.Generic.IEqualityComparer<T>
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © 2018–2023 Planetarium