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


Xceed.Wpf.ListBox Assembly > Xceed.Wpf.Data.Stats Namespace > StatFunction Class : IsEquivalent Method
The statistical function to verify.
Retrieves a value indicating whether a statistical function is the equivalent of the current function such that both will return the same result for the same set of values.
Syntax
'Declaration
 
Protected Friend Overridable Function IsEquivalent( _
   ByVal statFunction As StatFunction _
) As Boolean
'Usage
 
Dim instance As StatFunction
Dim statFunction As StatFunction
Dim value As Boolean
 
value = instance.IsEquivalent(statFunction)
protected internal virtual bool IsEquivalent( 
   StatFunction statFunction
)

Parameters

statFunction
The statistical function to verify.

Return Value

true of the specified statistical function is the equivalent of the current function; false otherwise.
Remarks

By default, this method verifies if the type of the statistical functions and the values of the SourcePropertyName properties are identical.

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