Пример #1
0
            public override Range <T> LessThan(T value)
            {
                var newBound = BoundValue <T> .LowerBound(value);

                if (newBound < lower)
                {
                    return(EmptyRange.Instance);
                }
                return(new SingleRange(lower, newBound.Min(upper)));
            }
Пример #2
0
            public override Range <T> GreaterThanOrEquals(T value)
            {
                var newBound = BoundValue <T> .LowerBound(value);

                if (upper < newBound)
                {
                    return(EmptyRange.Instance);
                }
                return(new SingleRange(newBound.Max(lower), upper));
            }
Пример #3
0
 public override bool Includes(T value)
 {
     return(lower <= BoundValue <T> .UpperBound(value) && BoundValue <T> .LowerBound(value) <= upper);
 }
Пример #4
0
 public static SingleRange ThatLessThan(T value)
 {
     return(new SingleRange(BoundValue <T> .NegativeInfinity, BoundValue <T> .LowerBound(value)));
 }
Пример #5
0
 public static SingleRange ThatGreaterThanOrEquals(T value)
 {
     return(new SingleRange(BoundValue <T> .LowerBound(value), BoundValue <T> .PositiveInfinity));
 }