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