/// <summary> /// Compares the current instance with another instance. /// </summary> /// <param name="other">The other instance.</param> /// <returns>The comparison result.</returns> /// <remarks><b>The First Char Index does not partecipate to the comparison.</b></remarks> public int CompareTo(BasicWordInfo other) { if (other == null) { return(1); } int res = Location.CompareTo(other.Location) * 2; return(res + WordIndex.CompareTo(other.WordIndex)); }
/// <summary> /// Compares the current instance with another instance. /// </summary> /// <param name="other">The other instance.</param> /// <returns>The comparison result.</returns> /// <remarks><b>The First Char Index does not partecipate to the comparison.</b></remarks> public int CompareTo(WordInfo other) { if (other == null) { return(1); } // text has a distance module of 1 // location has a distance module of 2 // wordIndex has a distance module of 3 int res = Location.CompareTo(other.Location) * 2; int res2 = WordIndex.CompareTo(other.WordIndex) * 3; return(res + res2 + Text.CompareTo(other.Text)); }