< Summary

Information
Class: MoreStructures.SuffixTries.SuffixTrieEdge
Assembly: MoreStructures
File(s): /home/runner/work/MoreStructures/MoreStructures/MoreStructures/SuffixTries/SuffixTrieEdge.cs
Line coverage
100%
Covered lines: 6
Uncovered lines: 0
Coverable lines: 6
Total lines: 39
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
get_Index()100%1100%
.ctor(...)100%1100%
CompareTo(...)100%2100%
ToString()100%1100%

File(s)

/home/runner/work/MoreStructures/MoreStructures/MoreStructures/SuffixTries/SuffixTrieEdge.cs

#LineLine coverage
 1using MoreStructures.SuffixStructures;
 2using MoreStructures.SuffixTrees;
 3
 4namespace MoreStructures.SuffixTries;
 5
 6/// <summary>
 7/// The index key of the collection of children of a <see cref="SuffixTrieNode"/>, which identifies a single char in
 8/// text, used as a selector to navigate the <see cref="SuffixTrieNode"/> in text pattern matching.
 9/// </summary>
 10/// <param name="Index">The index of the character in the text.</param>
 11/// <remarks>
 12/// Supports <see cref="IComparable{T}"/>, by <see cref="Index"/>.
 13/// </remarks>
 2405414public record SuffixTrieEdge(int Index)
 2175615    : SuffixTreeEdge(Index, 1), ISuffixStructureEdge<SuffixTrieEdge, SuffixTrieNode>, IComparable<SuffixTrieEdge>
 16{
 17    /// <inheritdoc path="//*[not(self::summary)]"/>
 18    /// <summary>
 19    ///     <inheritdoc/>
 20    ///     <br/>
 21    ///     Comparison is done by <see cref="Index"/>: lower is smaller, higher is bigger.
 22    /// </summary>
 23    /// <exception cref="ArgumentException">
 24    /// Thrown when <paramref name="other"/> is not a <see cref="SuffixTrieEdge"/>.
 25    /// </exception>
 26    public int CompareTo(SuffixTrieEdge? other) =>
 1027        other != null
 1028        ? Index - other.Index
 1029        : throw new ArgumentException($"Invalid comparison: cannot compare to null.");
 30
 31    /// <inheritdoc path="//*[not(self::summary)]"/>
 32    /// <summary>
 33    ///     <inheritdoc/>
 34    ///     <br/>
 35    ///     Generates a string in the form "(<see cref="SuffixTreeEdge.Start"/>)". <see cref="SuffixTreeEdge.Length"/>
 36    ///     is not included as in this context it is always 1.
 37    /// </summary>
 5438    public override string ToString() => $"({Start})";
 39}