public bool IsOverlap(IntRange range) { return(range.End >= Begin || range.Begin <= End); }
public IntRange Adjust(IntRange bounds) { var begin = Math.Max(Math.Min(End, bounds.End) - Length, bounds.Begin); return(new IntRange(begin, begin + Math.Min(Length, bounds.Length))); }
public bool IsInclude(IntRange range) { return(range.Begin >= Begin && range.End <= End); }
public bool Equals(IntRange other) { return(Begin == other.Begin && End == other.End); }