Beispiel #1
0
            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));
            }
Beispiel #2
0
            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)));
            }
Beispiel #3
0
 public override bool Includes(T value)
 {
     return(lower <= BoundValue <T> .UpperBound(value) && BoundValue <T> .LowerBound(value) <= upper);
 }
Beispiel #4
0
 public static SingleRange ThatLessThanOrEquals(T value)
 {
     return(new SingleRange(BoundValue <T> .NegativeInfinity, BoundValue <T> .UpperBound(value)));
 }
Beispiel #5
0
 public static SingleRange ThatGreaterThan(T value)
 {
     return(new SingleRange(BoundValue <T> .UpperBound(value), BoundValue <T> .PositiveInfinity));
 }