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
Implements
Inherited Members
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 SourceArrayEqualityComparer(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 SourceElementComparer
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 SourceEquals(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 |
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 |