Exemplo n.º 1
0
 public static Series <TKey, TValue, Range <TKey, TValue, TCursor> > Before <TKey, TValue, TCursor>(
     this Series <TKey, TValue, Range <TKey, TValue, TCursor> > series,
     TKey endKey, bool endInclusive = true)
     where TCursor : ISpecializedCursor <TKey, TValue, TCursor>
 {
     return(series.Range(Opt <TKey> .Missing, Opt.Present(endKey), true, endInclusive));
 }
Exemplo n.º 2
0
 public static Series <TKey, TValue, Range <TKey, TValue, TCursor> > After <TKey, TValue, TCursor>(
     this Series <TKey, TValue, Range <TKey, TValue, TCursor> > series,
     TKey startKey, bool startInclusive = true)
     where TCursor : ISpecializedCursor <TKey, TValue, TCursor>
 {
     return(series.Range(Opt.Present(startKey), Opt <TKey> .Missing, startInclusive, true));
 }
Exemplo n.º 3
0
 internal static Series <TKey, TValue, Range <TKey, TValue, TCursor> > Range <TKey, TValue, TCursor>(
     this Series <TKey, TValue, Range <TKey, TValue, TCursor> > series,
     TKey startKey, TKey endKey, bool startInclusive = true, bool endInclusive = true)
     where TCursor : ISpecializedCursor <TKey, TValue, TCursor>
 {
     return(series.Range(Opt.Present(startKey), Opt.Present(endKey), startInclusive, endInclusive));
 }
Exemplo n.º 4
0
 public static Series <TKey, TValue, Range <TKey, TValue, TCursor> > Range <TKey, TValue, TCursor>(
     this ContainerSeries <TKey, TValue, TCursor> series,
     TKey startKey, TKey endKey, bool startInclusive = true, bool endInclusive = true)
     where TCursor : ISpecializedCursor <TKey, TValue, TCursor>
 {
     // NB cast to Opt for overload resolution
     return(series.Range(Opt.Present(startKey), Opt.Present(endKey), startInclusive, endInclusive));
 }
Exemplo n.º 5
0
        // TODO make public

        internal static Series <TKey, TResult, Map <TKey, TInput, TResult, Range <TKey, TInput, TCursor> > > After <TKey, TInput, TResult, TCursor>(
            this Series <TKey, TResult, Map <TKey, TInput, TResult, TCursor> > series,
            TKey startKey, bool startInclusive = true)
            where TCursor : ISpecializedCursor <TKey, TInput, TCursor>
        {
            // NB trick - we move range before map, see how all maps are fused below
            // TODO (low) combine ranges in the example below
            var mapInner = series._cursor._cursor;
            var selector = series._cursor._selector;
            var range    = new Range <TKey, TInput, TCursor>(mapInner, Opt.Present(startKey), Opt <TKey> .Missing, startInclusive, true);
            var map      = new Map <TKey, TInput, TResult, Range <TKey, TInput, TCursor> >(range, selector);
            var res      = map.Source;

            return(res);
        }
Exemplo n.º 6
0
 public OutOfOrderKeyException(TKey currentKey, string message = "Out of order data") : base(message)
 {
     CurrentKey = Opt.Present(currentKey);
 }
Exemplo n.º 7
0
 public static Series <TKey, TValue, Range <TKey, TValue, Cursor <TKey, TValue> > > Before <TKey, TValue>(
     this ISeries <TKey, TValue> series,
     TKey endKey, bool endInclusive = true)
 {
     return(series.Range(Opt <TKey> .Missing, Opt.Present(endKey), true, endInclusive));
 }
Exemplo n.º 8
0
 public static Series <TKey, TValue, Range <TKey, TValue, Cursor <TKey, TValue> > > After <TKey, TValue>(
     this ISeries <TKey, TValue> series,
     TKey startKey, bool startInclusive = true)
 {
     return(series.Range(Opt.Present(startKey), Opt <TKey> .Missing, startInclusive, true));
 }
Exemplo n.º 9
0
 public static Series <TKey, TValue, Range <TKey, TValue, Cursor <TKey, TValue> > > Range <TKey, TValue>(
     this ISeries <TKey, TValue> series,
     TKey startKey, TKey endKey, bool startInclusive = true, bool endInclusive = true)
 {
     return(series.Range(Opt.Present(startKey), Opt.Present(endKey), startInclusive, endInclusive));
 }