Class ArrayEqualityComparer<T>
An 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.
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 |
---|---|---|
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 |
---|---|
IEqualityComparer<T> |
Methods
| Improve this Doc View SourceEquals(T[], T[])
An 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 |
---|---|
Boolean |
GetHashCode(T[])
An 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 |
---|---|
Int32 |