public virtual bool Overlaps(Interval <T> other) { if (other == null) { return(false); } var continuousLeft = (Lower.Inclusive || other.Upper.Inclusive) && Lower.CompareTo(other.Upper) == 0; var continuousRight = (other.Lower.Inclusive || Upper.Inclusive) && Upper.CompareTo(other.Lower) == 0; if (continuousRight || continuousLeft) { return(true); } return(Lower.IsBefore(other.Upper) && other.Lower.IsBefore(Upper)); }
private bool IsMinLessOrEqualsValue(T value) => Lower.CompareTo(value) <= 0;
public int CompareTo(Range other) { return(Lower.CompareTo(other.Lower)); }
public bool IsValid(object obj) => Lower.CompareTo(obj) <= 0 && Upper.CompareTo(obj) >= 0;
public override bool Contains(TRange test) { return(Lower.CompareTo(test) <= 0 && test.CompareTo(Upper) <= 0); }
public virtual bool Contains(TRange test) { return(Lower.CompareTo(test) <= 0 && test.CompareTo(Upper) < 0); }