Method GetHashCode
GetHashCode<T>(IList<T>)
The same implementation of GetHashCode from Java's AbstractList (the default implementation for all lists).
This algorithm depends on the order of the items in the list. It is recursive and will build the hash code based on the values of all nested collections.
Note this operation currently only supports
Declaration
public static int GetHashCode<T>(IList<T> list)
Parameters
Type | Name | Description |
---|---|---|
IList<T> | list |
Returns
Type | Description |
---|---|
System.Int32 |
Type Parameters
Name | Description |
---|---|
T |
GetHashCode<T>(ISet<T>)
The same implementation of GetHashCode from Java's AbstractSet (the default implementation for all sets)
This algorithm does not depend on the order of the items in the set. It is recursive and will build the hash code based on the values of all nested collections.
Note this operation currently only supports
Declaration
public static int GetHashCode<T>(ISet<T> set)
Parameters
Type | Name | Description |
---|---|---|
ISet<T> | set |
Returns
Type | Description |
---|---|
System.Int32 |
Type Parameters
Name | Description |
---|---|
T |
GetHashCode<TKey, TValue>(IDictionary<TKey, TValue>)
The same implementation of GetHashCode from Java's AbstractMap (the default implementation for all dictionaries)
This algoritm does not depend on the order of the items in the dictionary. It is recursive and will build the hash code based on the values of all nested collections.
Note this operation currently only supports
Declaration
public static int GetHashCode<TKey, TValue>(IDictionary<TKey, TValue> dictionary)
Parameters
Type | Name | Description |
---|---|---|
IDictionary<TKey, TValue> | dictionary |
Returns
Type | Description |
---|---|
System.Int32 |
Type Parameters
Name | Description |
---|---|
TKey | |
TValue |
GetHashCode(Object)
This method generally assists with the recursive GetHashCode() that builds a hash code based on all of the values in a collection including any nested collections (lists, sets, arrays, and dictionaries).
Note this currently only supports
Declaration
public static int GetHashCode(object obj)
Parameters
Type | Name | Description |
---|---|---|
System.Object | obj | the object to build the hash code for |
Returns
Type | Description |
---|---|
System.Int32 | a value that represents the unique state of all of the values and
nested collection values in the object, provided the main object itself is
a collection, otherwise calls |