public CompositeRange <T> MakeInclusive(
            [NotNull, InstantHandle] Func <T, T> fromValueSelector,
            [NotNull, InstantHandle] Func <T, T> toValueSelector)
        {
            if (IsEmpty)
            {
                return(this);
            }

            return(SubRanges
                   .Select(r => r.MakeInclusive(fromValueSelector, toValueSelector))
                   .ToCompositeRange());
        }
예제 #2
0
        public CompositeRange <T, TKey> MakeExclusive(
            [InstantHandle] Func <T, T> fromValueSelector,
            [InstantHandle] Func <T, T> toValueSelector)
        {
            if (IsEmpty)
            {
                return(this);
            }

            return(SubRanges
                   .Select(r => r.MakeExclusive(fromValueSelector, toValueSelector))
                   .Where(r => r.IsNotEmpty)
                   .ToCompositeRange());
        }
 public CompositeRange <T, TKey2> WithKeys <TKey2>(TKey2 key) =>
 IsEmpty
                         ? CompositeRange <T, TKey2> .Empty
                         : SubRanges.Select(s => s.WithKey(key)).ToCompositeRange();
예제 #4
0
 internal IEnumerable <Range <T> > GetMergedRanges() => _hasRangesToMerge
                 ? MergeRangesNoKeyCore(SubRanges)
                 : SubRanges.Select(r => r.WithoutKey());
예제 #5
0
 public CompositeRange <T> WithoutKeys() =>
 IsEmpty
                         ? CompositeRange <T> .Empty
                         : SubRanges.Select(s => s.WithoutKey()).ToCompositeRange();
예제 #6
0
 public CompositeRange <T, TKey2> WithKeys <TKey2>(
     [NotNull, InstantHandle] Func <TKey, TKey2> keySelector) =>
 IsEmpty
                                 ? CompositeRange <T, TKey2> .Empty
                                 : SubRanges.Select(s => s.WithKey(keySelector(s.Key))).ToCompositeRange();
 public CompositeRange <T2> WithValues <T2>(
     [NotNull, InstantHandle] Func <T, T2> fromValueSelector,
     [NotNull, InstantHandle] Func <T, T2> toValueSelector) =>
 IsEmpty
                                 ? CompositeRange <T2> .Empty
                                 : SubRanges.Select(s => s.WithValues(fromValueSelector, toValueSelector)).ToCompositeRange();
예제 #8
0
 public CompositeRange <T2, TKey> WithValues <T2>(
     [NotNull, InstantHandle] Func <T, T2> newValueSelector) =>
 IsEmpty
                                 ? CompositeRange <T2, TKey> .Empty
                                 : SubRanges.Select(s => s.WithValues(newValueSelector)).ToCompositeRange();
예제 #9
0
 private IEnumerable <Range <T> > GetMergedRanges() => _hasRangesToMerge
                 ? MergeRangesCore()
                 : SubRanges.Select(r => r.WithoutKey());