Esempio n. 1
0
            public RangeAlternativesIntCase()
            {
                _data             = new KeyValuePair <int, int> [Count];
                _rangeData        = new RangeStub <int> [Count];
                _rangeKeyData     = new RangeStub <int, string> [Count];
                _rangeCompactData = new RangeStubCompact <int> [Count];
                _rangeDataImpl    = new Range <int> [Count];
                _rangeKeyDataImpl = new Range <int, string> [Count];

                for (var i = 0; i < _data.Length; i++)
                {
                    _data[i]             = new KeyValuePair <int, int>(i, i + 1);
                    _rangeData[i]        = new RangeStub <int>(i, i + 1);
                    _rangeKeyData[i]     = new RangeStub <int, string>(i, i + 1, i.ToString());
                    _rangeCompactData[i] = new RangeStubCompact <int>(i, i + 1);
                    _rangeDataImpl[i]    = new Range <int>(i, i + 1);
                    _rangeKeyDataImpl[i] = new Range <int, string>(i, i + 1, i.ToString());
                }
            }
 public static RangeStubCompact <T> Union <T>(this RangeStubCompact <T> range, RangeStubCompact <T> other) =>
 range.CreateRange(
     range.From <= other.From ? range.From : other.From,
     (range.To.IsEmpty || range.To >= other.To) ? range.To : other.To);
Esempio n. 3
0
 public static RangeStubCompact <T> Union <T, TRange>(this RangeStubCompact <T> range1, TRange range2)
     where TRange : IRange <T> =>
 UnionCore <RangeStubCompact <T>, TRange, T>(range1, range2);