Class ComparisonUtility
Provides methods for performing logical comparison operations. This class cannot be inherited.
Inheritance
Inherited Members
Namespace: Argotic.Common
Assembly: Argotic.Common.dll
Syntax
public static class ComparisonUtility
Remarks
Primary used within this framework to determine the lexical relationship between generic collections.
Methods
| Improve this Doc View SourceCompareSequence(Dictionary<String, String>, Dictionary<String, String>, StringComparison)
Compares two specified generic dictionaries.
Declaration
public static int CompareSequence(Dictionary<string, string> source, Dictionary<string, string> target, StringComparison comparisonType)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.Dictionary<System.String, System.String> | source | The first collection. |
System.Collections.Generic.Dictionary<System.String, System.String> | target | The second collection. |
System.StringComparison | comparisonType | Specifies the culture, case, and sort rules to be used when determining the lexical relationship. |
Returns
Type | Description |
---|---|
System.Int32 | A 32-bit signed integer indicating the lexical relationship between the two comparands. |
Remarks
If the collections contain the same number of elements, determines the lexical relationship between the two sequences of comparands.
If the source
has an element count that is greater than the target
element count, returns 1.
If the source
has an element count that is less than the target
element count, returns -1.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The |
System.ArgumentNullException | The |
CompareSequence(Collection<DayOfWeek>, Collection<DayOfWeek>)
Compares two specified generic collections.
Declaration
public static int CompareSequence(Collection<DayOfWeek> source, Collection<DayOfWeek> target)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.ObjectModel.Collection<System.DayOfWeek> | source | The first collection. |
System.Collections.ObjectModel.Collection<System.DayOfWeek> | target | The second collection. |
Returns
Type | Description |
---|---|
System.Int32 | A 32-bit signed integer indicating the lexical relationship between the two comparands. |
Remarks
If the collections contain the same number of elements, determines the lexical relationship between the two sequences of comparands.
If the source
has an element count that is greater than the target
element count, returns 1.
If the source
has an element count that is less than the target
element count, returns -1.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The |
System.ArgumentNullException | The |
CompareSequence(Collection<Int32>, Collection<Int32>)
Compares two specified generic collections.
Declaration
public static int CompareSequence(Collection<int> source, Collection<int> target)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.ObjectModel.Collection<System.Int32> | source | The first collection. |
System.Collections.ObjectModel.Collection<System.Int32> | target | The second collection. |
Returns
Type | Description |
---|---|
System.Int32 | A 32-bit signed integer indicating the lexical relationship between the two comparands. |
Remarks
If the collections contain the same number of elements, determines the lexical relationship between the two sequences of comparands.
If the source
has an element count that is greater than the target
element count, returns 1.
If the source
has an element count that is less than the target
element count, returns -1.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The |
System.ArgumentNullException | The |
CompareSequence(Collection<Int64>, Collection<Int64>)
Compares two specified generic collections.
Declaration
public static int CompareSequence(Collection<long> source, Collection<long> target)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.ObjectModel.Collection<System.Int64> | source | The first collection. |
System.Collections.ObjectModel.Collection<System.Int64> | target | The second collection. |
Returns
Type | Description |
---|---|
System.Int32 | A 32-bit signed integer indicating the lexical relationship between the two comparands. |
Remarks
If the collections contain the same number of elements, determines the lexical relationship between the two sequences of comparands.
If the source
has an element count that is greater than the target
element count, returns 1.
If the source
has an element count that is less than the target
element count, returns -1.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The |
System.ArgumentNullException | The |
CompareSequence(Collection<String>, Collection<String>, StringComparison)
Compares two specified generic collections.
Declaration
public static int CompareSequence(Collection<string> source, Collection<string> target, StringComparison comparisonType)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.ObjectModel.Collection<System.String> | source | The first collection. |
System.Collections.ObjectModel.Collection<System.String> | target | The second collection. |
System.StringComparison | comparisonType | Specifies the culture, case, and sort rules to be used when determining the lexical relationship. |
Returns
Type | Description |
---|---|
System.Int32 | A 32-bit signed integer indicating the lexical relationship between the two comparands. |
Remarks
If the collections contain the same number of elements, determines the lexical relationship between the two sequences of comparands.
If the source
has an element count that is greater than the target
element count, returns 1.
If the source
has an element count that is less than the target
element count, returns -1.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The |
System.ArgumentNullException | The |
CompareSequence(Collection<Type>, Collection<Type>)
Compares two specified generic collections.
Declaration
public static int CompareSequence(Collection<Type> source, Collection<Type> target)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.ObjectModel.Collection<System.Type> | source | The first collection. |
System.Collections.ObjectModel.Collection<System.Type> | target | The second collection. |
Returns
Type | Description |
---|---|
System.Int32 | A 32-bit signed integer indicating the lexical relationship between the two comparands. |
Remarks
If the collections contain the same number of elements, determines the lexical relationship between the two sequences of comparands.
If the source
has an element count that is greater than the target
element count, returns 1.
If the source
has an element count that is less than the target
element count, returns -1.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The |
System.ArgumentNullException | The |
CompareSequence(Collection<Uri>, Collection<Uri>, StringComparison)
Compares two specified generic collections.
Declaration
public static int CompareSequence(Collection<Uri> source, Collection<Uri> target, StringComparison comparisonType)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.ObjectModel.Collection<System.Uri> | source | The first collection. |
System.Collections.ObjectModel.Collection<System.Uri> | target | The second collection. |
System.StringComparison | comparisonType | Specifies the culture, case, and sort rules to be used when determining the lexical relationship. |
Returns
Type | Description |
---|---|
System.Int32 | A 32-bit signed integer indicating the lexical relationship between the two comparands. |
Remarks
If the collections contain the same number of elements, determines the lexical relationship between the two sequences of comparands.
If the source
has an element count that is greater than the target
element count, returns 1.
If the source
has an element count that is less than the target
element count, returns -1.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The |
System.ArgumentNullException | The |
CompareSequence(Collection<XPathNavigator>, Collection<XPathNavigator>)
Compares two specified generic collections.
Declaration
public static int CompareSequence(Collection<XPathNavigator> source, Collection<XPathNavigator> target)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.ObjectModel.Collection<System.Xml.XPath.XPathNavigator> | source | The first collection. |
System.Collections.ObjectModel.Collection<System.Xml.XPath.XPathNavigator> | target | The second collection. |
Returns
Type | Description |
---|---|
System.Int32 | A 32-bit signed integer indicating the lexical relationship between the two comparands. |
Remarks
If the collections contain the same number of elements, determines the lexical relationship between the two sequences of comparands.
If the source
has an element count that is greater than the target
element count, returns 1.
If the source
has an element count that is less than the target
element count, returns -1.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | The |
System.ArgumentNullException | The |