Class RuneComparer
Represents Rune comparison operation that uses specific case and culture-based or ordinal comparison rules.
Inherited Members
Namespace: DotNext.Text
Assembly: DotNext.dll
Syntax
public abstract class RuneComparer : IEqualityComparer<Rune>, IComparer<Rune>
Constructors
View SourceRuneComparer()
Initializes a new instance of comparer.
Declaration
protected RuneComparer()
Methods
View SourceCompare(Rune, Rune)
Compares two runes and returns an indication of their relative sort order.
Declaration
public abstract int Compare(Rune x, Rune y)
Parameters
| Type | Name | Description |
|---|---|---|
| Rune | x | The first rune to compare. |
| Rune | y | The second rune to compare. |
Returns
| Type | Description |
|---|---|
| int | A number indicating relative sort order of the runes. |
Compare(Rune, Rune, StringComparison)
Compares two runes and returns an indication of their relative sort order.
Declaration
public static int Compare(Rune x, Rune y, StringComparison comparisonType)
Parameters
| Type | Name | Description |
|---|---|---|
| Rune | x | The first rune to compare. |
| Rune | y | The second rune to compare. |
| StringComparison | comparisonType | The comparison type. |
Returns
| Type | Description |
|---|---|
| int | A number indicating relative sort order of the runes. |
Create(CultureInfo, CompareOptions)
Creates rune comparer for the specified culture.
Declaration
public static RuneComparer Create(CultureInfo culture, CompareOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| CultureInfo | culture | A culture whose linguistic rules are used to perform a string comparison. |
| CompareOptions | options | Comparison options. |
Returns
| Type | Description |
|---|---|
| RuneComparer | Culture-specific comparer. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException |
|
Equals(Rune, Rune)
Determines whether the two runes are equal.
Declaration
public abstract bool Equals(Rune x, Rune y)
Parameters
| Type | Name | Description |
|---|---|---|
| Rune | x | The first rune to compare. |
| Rune | y | The second rune to compare. |
Returns
| Type | Description |
|---|---|
| bool |
Equals(Rune, Rune, StringComparison)
Determines whether the two runes are equal.
Declaration
public static bool Equals(Rune x, Rune y, StringComparison comparisonType)
Parameters
| Type | Name | Description |
|---|---|---|
| Rune | x | The first rune to compare. |
| Rune | y | The second rune to compare. |
| StringComparison | comparisonType | The comparison type. |
Returns
| Type | Description |
|---|---|
| bool |
FromComparison(StringComparison)
Converts StringComparison to RuneComparer.
Declaration
public static RuneComparer FromComparison(StringComparison comparison)
Parameters
| Type | Name | Description |
|---|---|---|
| StringComparison | comparison | A rune comparer instance to convert. |
Returns
| Type | Description |
|---|---|
| RuneComparer | A comparer representing the specified comparison type. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException |
|
GetHashCode(Rune)
Gets the hash code for the specified rune.
Declaration
public abstract int GetHashCode(Rune rune)
Parameters
| Type | Name | Description |
|---|---|---|
| Rune | rune | A rune. |
Returns
| Type | Description |
|---|---|
| int | A hash code of the rune. |
GetHashCode(Rune, StringComparison)
Gets the hash code for the specified rune.
Declaration
public static int GetHashCode(Rune rune, StringComparison comparisonType)
Parameters
| Type | Name | Description |
|---|---|---|
| Rune | rune | A rune. |
| StringComparison | comparisonType | The comparison type. |
Returns
| Type | Description |
|---|---|
| int | A hash code of the rune. |