public override Range <T> GreaterThan(T value) { var newBound = BoundValue <T> .UpperBound(value); if (upper < newBound) { return(EmptyRange.Instance); } return(new SingleRange(newBound.Max(lower), upper)); }
public override Range <T> LessThanOrEquals(T value) { var newBound = BoundValue <T> .UpperBound(value); if (newBound < lower) { return(EmptyRange.Instance); } return(new SingleRange(lower, newBound.Min(upper))); }
public override bool Includes(T value) { return(lower <= BoundValue <T> .UpperBound(value) && BoundValue <T> .LowerBound(value) <= upper); }
public static SingleRange ThatLessThanOrEquals(T value) { return(new SingleRange(BoundValue <T> .NegativeInfinity, BoundValue <T> .UpperBound(value))); }
public static SingleRange ThatGreaterThan(T value) { return(new SingleRange(BoundValue <T> .UpperBound(value), BoundValue <T> .PositiveInfinity)); }