Search Results for

    Show / Hide Table of Contents

    Class CharOrTerminatorComparer

    An implementation of for System.Char, which compares chars taking into account the fact that the char may be a special char, called terminator, which has to be considered smaller than any other char.

    Inheritance
    System.Object
    CharOrTerminatorComparer
    Namespace: MoreStructures.Utilities
    Assembly: MoreStructures.dll
    Syntax
    public class CharOrTerminatorComparer : IComparer<char>

    Properties

    | Improve this Doc View Source

    Terminator

    The character acting as terminator, and which has to be considered smaller than any other char.

    Declaration
    public char Terminator { get; }
    Property Value
    Type Description
    System.Char

    Methods

    | Improve this Doc View Source

    Build(Char)

    Builds a CharOrTerminatorComparer with the provided terminator. Caches instances.

    Declaration
    public static CharOrTerminatorComparer Build(char terminator)
    Parameters
    Type Name Description
    System.Char terminator

    Returns
    Type Description
    CharOrTerminatorComparer

    An instance of CharOrTerminatorComparer, new or previously created and cached.

    | Improve this Doc View Source

    Compare(Char, Char)

    Declaration
    public int Compare(char x, char y)
    Parameters
    Type Name Description
    System.Char x
    System.Char y
    Returns
    Type Description
    System.Int32
    Remarks

    Special rules applied by CharOrTerminatorComparer:

    • If one char is the terminator, and the other isn't, the one which is the terminator is smaller.
    • If none of the cases above applies, System.Char.CompareTo(System.Char) is used on x and y.
    | Improve this Doc View Source

    Equals(Object)

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.Boolean
    Remarks

    Two CharOrTerminatorComparer are equal if they have the same Terminator.

    | Improve this Doc View Source

    GetHashCode()

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Remarks

    The GetHashCode() is based on Terminator hash.

    Extension Methods

    SuffixStructureNodeExtensions.GetAllSuffixesFor<TEdge, TNode>(TNode, TextWithTerminator)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX