Method GetHashCode
GetHashCode()
Returns the hash code value for this set. The hash code of a set
is defined to be the sum of the hash codes of the elements in the
set, where the hash code of a null
element is defined to be zero.
This ensures that s1.Equals(s2)
implies that
s1.GetHashCode()==s2.GetHashCode()
for any two sets s1 and s2.
This implementation iterates over the set, calling the GetHashCode()
method on each element in the set, and adding up the results.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
System.Int32 | the hash code value for this set |
Overrides
System.Object.GetHashCode()