/// <summary> /// Compare the position to another position. /// </summary> /// <param name="other"> /// The other position. /// </param> /// <returns> /// 0 if the positions are equal, greater than 0 if the other position is less than the current position, less than 0 if the other position is greater than the current position. /// </returns> public int CompareTo(Position other) { if (other == null) { throw new ArgumentNullException(nameof(other)); } if (IsOneBased) { other = other.ToOneBased(); } else if (IsZeroBased) { other = other.ToZeroBased(); } int lineComparison = LineNumber.CompareTo(other.LineNumber); if (lineComparison != 0) { return(lineComparison); } return(ColumnNumber.CompareTo(other.ColumnNumber)); }
public int CompareTo(GrepLine other) { if (other == null) { return(1); } else { return(LineNumber.CompareTo(other.LineNumber)); } }
public int CompareTo(object obj) { if (obj == null) { return(1); } if (obj is GrepLine) { return(LineNumber.CompareTo(((GrepLine)obj).LineNumber)); } else { return(1); } }
public int CompareTo(ClangLocation other) { // ReSharper disable once JoinDeclarationAndInitializer int result; result = string.Compare(FileName, other.FileName, StringComparison.Ordinal); // ReSharper disable once ConvertIfStatementToReturnStatement if (result != 0) { return(result); } result = LineNumber.CompareTo(other.LineNumber); return(result); }
/// <summary> /// Compare the position to another position. /// </summary> /// <param name="other"> /// The other position. /// </param> /// <returns> /// 0 if the positions are equal, greater than 0 if the other position is less than the current position, less than 0 if the other position is greater than the current position. /// </returns> public int CompareTo(Position other) { if (other == null) { throw new ArgumentNullException(nameof(other)); } int lineComparison = LineNumber.CompareTo(other.LineNumber); if (lineComparison != 0) { return(lineComparison); } return(ColumnNumber.CompareTo(other.ColumnNumber)); }
public int CompareTo(Event other) { var comparison = Timestamp.CompareTo(other.Timestamp); if (comparison != 0) { return(comparison); } comparison = LineNumber.CompareTo(other.LineNumber); if (comparison != 0) { return(comparison); } return(Comparer <EventType> .Default.Compare(Type, other.Type)); }
/// <summary> /// Compare the position to another position. /// </summary> /// <param name="other"> /// The other position. /// </param> /// <returns> /// 0 if the positions are equal, greater than 0 if the other position is less than the current position, less than 0 if the other position is greater than the current position. /// </returns> public int CompareTo(Position other) { if (IsOneBased) { other = other.ToOneBased(); } else if (IsZeroBased) { other = other.ToZeroBased(); } int lineComparison = LineNumber.CompareTo(other.LineNumber); if (lineComparison != 0) { return(lineComparison); } return(ColumnNumber.CompareTo(other.ColumnNumber)); }
/// <summary> /// Compares this Tbasic.Line to another Tbasic.Line by comparing their LineNumber /// </summary> /// <param name="other"></param> /// <returns></returns> public int CompareTo(Line other) { return(LineNumber.CompareTo(other.LineNumber)); }
public int CompareTo( ValueEnum <TValue> obj) { return(LineNumber.CompareTo(obj.LineNumber)); }