Xceed Toolkit Plus for WPF v4.6 Documentation
GetEquivalenceKey Method (StatFunction)


Xceed.Wpf.ListBox Assembly > Xceed.Wpf.Data.Stats Namespace > StatFunction Class : GetEquivalenceKey Method
Retrieves a value that represents the statistical function's unique equivalence key.
Syntax
'Declaration
 
Protected Friend Overridable Function GetEquivalenceKey() As Integer
'Usage
 
Dim instance As StatFunction

Dim value As Integer

 

value = instance.GetEquivalenceKey()
protected internal virtual int GetEquivalenceKey()

Return Value

A value representing the statistical function's unique equivalence key.
Remarks

The IsEquivalent and GetEquivalenceKey methods are similar to the Equals and GetHashCode methods

The GetEquivalenceKey method should return the same value for two statistical function instances that would return the same result for the same value list. All properties that have an impact on the result should be reflected in the override. If a property does not impact the result, it should not modify the equivalence key.

The IsEquivalent method should compare each property that affects the function's result and return true if they are all equal.

For instance, the CountFunction's override of the GetEquivalenceKey method will return a combination of typeof(CountFunction).GetHashCode(), SourcePropertyName.GetHashCode(), and IncludeNullValues.GetHashCode(). This means that two CountFunction instances that have the same values for the SourcePropertyName and IncludeNullValues properties will return the same equivalence key. A hypothetical "LogResult" property that does not have an effect on the result would not be considered in this override.

Similarly, the IsEquivalent method will return false if any of these 3 criteria (StatFunction type, SourcePropertyName, or IncludeNullValues) are different when compared with the specified StatFunction parameter.

When deriving from the StatFunction class, the IsEquivalent method should be overridden only if a property that affects the end result is added. In this case, GetEquivalenceKey should also be overridden to return a new key.

Requirements

Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

StatFunction Class
StatFunction Members