Search Results for

    Show / Hide Table of Contents

    Class RotatedTextWithTerminator

    A text string with a terminator character which has been rotated leftwards or rightwards, of a number of positions (0 included).

    Inheritance
    System.Object
    RotatedTextWithTerminator
    Implements
    IValueEnumerable<System.Char>
    IEnumerable<System.Char>
    System.IEquatable<RotatedTextWithTerminator>
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: MoreStructures
    Assembly: MoreStructures.dll
    Syntax
    public class RotatedTextWithTerminator : IValueEnumerable<char>, IEquatable<RotatedTextWithTerminator>
    Remarks

    USECASES
    - A terminator-terminated rotated text is required by Burrows-Wheeler Transform operations, such as inversion.
    - This object provides type safety, as it allows to tell apart rotated terminator-terminated strings from generic ones.
    - Consistently using RotatedTextWithTerminator, rather than System.String, in all library functionalities ensures that the invariant of a rotated terminator-terminated string is always respected.
    - Most string-related functionalities provided by RotatedTextWithTerminator, such as Length and Item[Index], as well as and System.Collections.IEnumerable support, are delegated to the underlying string.

    Constructors

    | Improve this Doc View Source

    RotatedTextWithTerminator(IEnumerable<Char>, Char, Boolean)

    A text string with a terminator character which has been rotated leftwards or rightwards, of a number of positions (0 included).

    Declaration
    public RotatedTextWithTerminator(IEnumerable<char> RotatedText, char Terminator = '$', bool ValidateInput = true)
    Parameters
    Type Name Description
    System.Collections.IEnumerable<System.Char> RotatedText

    The text, defined as an of chars and containing the terminator character once, in any position of the text.

    System.Char Terminator

    A terminator character, present in the text at most once. If not specified DefaultTerminator is used.

    System.Boolean ValidateInput

    Whether the input, and in particular RotatedText should be validated, while this object is created. Validation takes O(n) time, where n = number of chars in RotatedText and can be an heavy operation.

    Remarks

    USECASES
    - A terminator-terminated rotated text is required by Burrows-Wheeler Transform operations, such as inversion.
    - This object provides type safety, as it allows to tell apart rotated terminator-terminated strings from generic ones.
    - Consistently using RotatedTextWithTerminator, rather than System.String, in all library functionalities ensures that the invariant of a rotated terminator-terminated string is always respected.
    - Most string-related functionalities provided by RotatedTextWithTerminator, such as Length and Item[Index], as well as and System.Collections.IEnumerable support, are delegated to the underlying string.

    Properties

    | Improve this Doc View Source

    Item[Index]

    Select a part of RotatedText by the provided index (either w.r.t. the start or to the end of the text).

    Declaration
    public char this[Index index] { get; }
    Parameters
    Type Name Description
    Index index

    The index applied to the underlying string.

    Property Value
    Type Description
    System.Char

    A char containing the selected part.

    | Improve this Doc View Source

    Item[TextWithTerminator.ISelector]

    Select a part of RotatedText by the provided selector.

    Declaration
    public string this[TextWithTerminator.ISelector selector] { get; }
    Parameters
    Type Name Description
    TextWithTerminator.ISelector selector

    Any selector acting on a RotatedTextWithTerminator.

    Property Value
    Type Description
    System.String

    A string containing the selected part.

    | Improve this Doc View Source

    Item[Range]

    Select a part of RotatedText by the provided range (start index included, end index excluded).

    Declaration
    public IEnumerable<char> this[Range range] { get; }
    Parameters
    Type Name Description
    Range range

    The range applied to the underlying string.

    Property Value
    Type Description
    System.Collections.IEnumerable<System.Char>

    A sequence of chars containing the selected part.

    | Improve this Doc View Source

    Length

    The total length of RotatedText, including the terminator.

    Declaration
    public int Length { get; }
    Property Value
    Type Description
    System.Int32

    A positive integer (at least 1).

    Remarks

    | Improve this Doc View Source

    RotatedText

    Declaration
    public IEnumerable<char> RotatedText { get; set; }
    Property Value
    Type Description
    System.Collections.IEnumerable<System.Char>

    A sequence of chars.

    Remarks

    Wrapped into a IValueEnumerable<T> to preserve value equality.

    | Improve this Doc View Source

    Terminator

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

    A single char.

    | Improve this Doc View Source

    ValidateInput

    Declaration
    public bool ValidateInput { get; set; }
    Property Value
    Type Description
    System.Boolean

    Methods

    | Improve this Doc View Source

    EndsWith(String)

    Whether this text ends with suffix.

    Declaration
    public bool EndsWith(string suffix)
    Parameters
    Type Name Description
    System.String suffix

    A terminator-included string.

    Returns
    Type Description
    System.Boolean

    True if RotatedText ends by suffix.

    | Improve this Doc View Source

    GetEnumerator()

    Returns an enumerator that iterates through the collection of chars of the underlying RotatedText string, including the Terminator char.

    Declaration
    public IEnumerator<char> GetEnumerator()
    Returns
    Type Description
    System.Collections.IEnumerator<System.Char>
    | Improve this Doc View Source

    StartsWith(String)

    Whether this text starts with prefix.

    Declaration
    public bool StartsWith(string prefix)
    Parameters
    Type Name Description
    System.String prefix

    A terminator-included string.

    Returns
    Type Description
    System.Boolean

    True if RotatedText starts by prefix.

    Explicit Interface Implementations

    | Improve this Doc View Source

    IEnumerable.GetEnumerator()

    Returns an enumerator that iterates through the collection of chars of the underlying RotatedText string, including the Terminator char.

    Declaration
    IEnumerator IEnumerable.GetEnumerator()
    Returns
    Type Description
    System.Collections.IEnumerator

    Implements

    IValueEnumerable<T>
    IEnumerable<>
    System.IEquatable<T>

    Extension Methods

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