Example #1
0
 /// <summary>Applies a key-generating function to each element of the input CloudFlow and yields the CloudFlow of the given length, ordered by keys.</summary>
 /// <param name="projection">A function to transform items of the input CloudFlow into comparable keys.</param>
 /// <param name="stream">The input CloudFlow.</param>
 /// <param name="takeCount">The number of elements to return.</param>
 /// <returns>The result CloudFlow.</returns>
 public static CloudFlow <TSource> OrderBy <TSource, TKey>(this CloudFlow <TSource> stream, Func <TSource, TKey> projection, int takeCount) where TKey : IComparable <TKey>
 {
     return(CSharpProxy.OrderBy(stream, projection, takeCount));
 }
Example #2
0
 /// <summary>Applies a function to each element of the stream, threading an accumulator argument through the computation. If the input function is f and the elements are i0...iN, then this function computes f (... (f s i0)...) iN.</summary>
 /// <param name="folder">A function that updates the state with each element from the stream.</param>
 /// <param name="state">The initial state.</param>
 /// <param name="stream">The input stream.</param>
 /// <returns>The final result.</returns>
 public static TAccumulate Aggregate<TSource, TAccumulate>(this Stream<TSource> stream, TAccumulate state, Func<TAccumulate, TSource, TAccumulate> folder)
 {
     return CSharpProxy.Aggregate(stream, state, folder);
 }
Example #3
0
 /// <summary>Applies a key-generating function to each element of the input stream and yields a stream of unique keys and a sequence of all elements that have each key.</summary>
 /// <param name="projection">A function to transform items of the input stream into comparable keys.</param>
 /// <param name="stream">The input stream.</param>
 /// <returns>A stream of IGrouping.</returns>    
 public static Stream<System.Linq.IGrouping<TKey, TSource>> GroupBy<TSource, TKey>(this Stream<TSource> stream, Func<TSource, TKey> projection) 
 {
     return CSharpProxy.GroupBy(stream, projection);
 }
Example #4
0
 /// <summary>Applies a key-generating function to each element of the input stream and yields a stream of unique keys and their frequency.</summary>
 /// <param name="projection">A function to transform items of the input stream into comparable keys.</param>
 /// <param name="stream">The input stream.</param>
 /// <returns>A stream of tuples where each tuple contains the unique key and a sequence of all the elements that match the key.</returns>    
 public static Stream<Tuple<TKey, int>> CountBy<TSource, TKey>(this Stream<TSource> stream, Func<TSource, TKey> projection)
 {
     return CSharpProxy.CountBy(stream, projection);
 }
Example #5
0
 /// <summary>Filters the elements of the input stream.</summary>
 /// <param name="predicate">A function to test each source element for a condition.</param>
 /// <param name="stream">The input stream.</param>
 /// <returns>The result stream.</returns>
 public static Stream<TSource> Where<TSource>(this Stream<TSource> stream, Func<TSource, bool> predicate)
 {
     return CSharpProxy.Where(stream, predicate);
 }
Example #6
0
 /// <summary>Returns the first element for which the given function returns true. Raises KeyNotFoundException if no such element exists.</summary>
 /// <param name="predicate">A function to test each source element for a condition.</param>
 /// <param name="stream">The input stream.</param>
 /// <returns>The first element for which the predicate returns true.</returns>
 /// <exception cref="System.Collections.Generic.KeyNotFoundException">Thrown if the predicate evaluates to false for all the elements of the stream.</exception>
 public static TSource First<TSource>(this Stream<TSource> stream, Func<TSource, bool> predicate)
 {
     return CSharpProxy.First(stream, predicate);
 }
Example #7
0
 /// <summary>Locates the minimum element of the stream by given key.</summary>
 /// <param name="projection">A function to transform items of the input stream into comparable keys.</param>
 /// <param name="source">The input stream.</param>
 /// <returns>The maximum item.</returns>  
 public static TSource MinBy<TSource, TKey>(this Stream<TSource> source, Func<TSource, TKey> projection)
 {
     return CSharpProxy.MinBy(source, projection);
 }
Example #8
0
 /// <summary>Constructs a CloudFlow from a collection of CloudFiles using the given reader.</summary>
 /// <param name="reader">A function to transform the contents of a CloudFile to an object.</param>
 /// <param name="sources">The collection of CloudFiles.</param>
 /// <returns>The result CloudFlow.</returns>
 public static CloudFlow <TResult> AsCloudFlow <TResult>(this IEnumerable <CFile> sources, Func <System.IO.Stream, Task <TResult> > reader)
 {
     return(CSharpProxy.OfCloudFiles <TResult>(sources, reader));
 }
Example #9
0
 /// <summary>Transforms each element of the input CloudFlow.</summary>
 /// <param name="f">A function to transform items from the input CloudFlow.</param>
 /// <param name="stream">The input CloudFlow.</param>
 /// <returns>The result CloudFlow.</returns>
 public static CloudFlow <TResult> Select <TSource, TResult>(this CloudFlow <TSource> stream, Func <TSource, TResult> f)
 {
     return(CSharpProxy.Select(stream, f));
 }
Example #10
0
 /// <summary>Returns the total number of elements of the CloudFlow.</summary>
 /// <param name="stream">The input CloudFlow.</param>
 /// <returns>The total number of elements.</returns>
 public static Cloud <long> Count <TSource>(this CloudFlow <TSource> stream)
 {
     return(CSharpProxy.Count(stream));
 }
Example #11
0
 /// <summary>
 /// Applies a key-generating function to each element of a CloudFlow and return a CloudFlow yielding unique keys and their number of occurrences in the original sequence.
 /// </summary>
 /// <param name="projection">A function that maps items from the input CloudFlow to keys.</param>
 /// <param name="stream">The input CloudFlow.</param>
 public static CloudFlow <Tuple <TKey, long> > CountBy <TSource, TKey>(this CloudFlow <TSource> stream, Func <TSource, TKey> projection)
 {
     return(CSharpProxy.CountBy(stream, projection));
 }
Example #12
0
 /// <summary>Returns the sum of the elements.</summary>
 /// <param name="stream">The input CloudFlow.</param>
 /// <returns>The sum of the elements.</returns>
 public static Cloud <decimal> Sum(this CloudFlow <decimal> stream)
 {
     return(CSharpProxy.Sum(stream));
 }
Example #13
0
 /// <summary>Returns the sum of the elements.</summary>
 /// <param name="stream">The input CloudFlow.</param>
 /// <returns>The sum of the elements.</returns>
 public static Cloud <float> Sum(this CloudFlow <float> stream)
 {
     return(CSharpProxy.Sum(stream));
 }
Example #14
0
 /// <summary>Returns the sum of the elements.</summary>
 /// <param name="stream">The input CloudFlow.</param>
 /// <returns>The sum of the elements.</returns>
 public static Cloud <long> Sum(this CloudFlow <long> stream)
 {
     return(CSharpProxy.Sum(stream));
 }
Example #15
0
 /// <summary>Returns the sum of the elements.</summary>
 /// <param name="stream">The input stream.</param>
 /// <returns>The sum of the elements.</returns>
 public static decimal Sum(this Stream<decimal> stream)
 {
     return CSharpProxy.Sum(stream);
 }
Example #16
0
 /// <summary>Filters the elements of the input CloudFlow.</summary>
 /// <param name="predicate">A function to test each source element for a condition.</param>
 /// <param name="stream">The input CloudFlow.</param>
 /// <returns>The result CloudFlow.</returns>
 public static CloudFlow <TSource> Where <TSource>(this CloudFlow <TSource> stream, Func <TSource, bool> predicate)
 {
     return(CSharpProxy.Where(stream, predicate));
 }
Example #17
0
 /// <summary>Returns the total number of elements of the stream.</summary>
 /// <param name="stream">The input stream.</param>
 /// <returns>The total number of elements.</returns>
 public static int Count<TSource>(this Stream<TSource> stream)
 {
     return CSharpProxy.Count(stream);
 }
Example #18
0
 /// <summary>Transforms each element of the input CloudFlow to a new stream and flattens its elements.</summary>
 /// <param name="f">A function to transform items from the input CloudFlow.</param>
 /// <param name="stream">The input CloudFlow.</param>
 /// <returns>The result CloudFlow.</returns>
 public static CloudFlow <TResult> SelectMany <TSource, TResult>(this CloudFlow <TSource> stream, Func <TSource, IEnumerable <TResult> > f)
 {
     return(CSharpProxy.SelectMany(stream, f));
 }
Example #19
0
 /// <summary>Tests if all elements of the stream satisfy the given predicate.</summary>
 /// <param name="predicate">A function to test each source element for a condition.</param>
 /// <param name="stream">The input stream.</param>
 /// <returns>true if all of the elements satisfies the predicate. Otherwise, returns false.</returns>
 public static bool All<TSource>(this Stream<TSource> stream, Func<TSource, bool> predicate)
 {
     return CSharpProxy.All(stream, predicate);
 }
Example #20
0
 /// <summary>Applies a function to each element of the CloudFlow, threading an accumulator argument through the computation. If the input function is f and the elements are i0...iN, then this function computes f (... (f s i0)...) iN.</summary>
 /// <param name="folder">A function that updates the state with each element from the CloudFlow.</param>
 /// <param name="combiner">A function that combines partial states into a new state.</param>
 /// <param name="state">A function that produces the initial state.</param>
 /// <param name="stream">The input CloudFlow.</param>
 /// <returns>The final result.</returns>
 public static Cloud <TAccumulate> Aggregate <TSource, TAccumulate>(this CloudFlow <TSource> stream, Func <TAccumulate> state, Func <TAccumulate, TSource, TAccumulate> folder, Func <TAccumulate, TAccumulate, TAccumulate> combiner)
 {
     return(CSharpProxy.Aggregate(stream, state, folder, combiner));
 }
Example #21
0
 /// <summary>Applies a state-updating function to a stream of inputs, grouped by key projection.</summary>
 /// <param name="projection">A function to transform items of the input stream into comparable keys.</param>
 /// <param name="folder">Folding function.</param>
 /// <param name="init">State initializing function.</param>
 /// <param name="source">The input stream.</param>
 /// <returns>A stream of tuples where each tuple contains the unique key and a sequence of all the elements that match the key.</returns>    
 public static Stream<Tuple<TKey, TState>> AggregateBy<TSource, TKey, TState>(this Stream<TSource> source, Func<TSource,TKey> projection, Func<TState, TSource, TState> folder, Func<TState> init)
 {
     return CSharpProxy.AggregateBy(source, projection, folder, init);
 }
Example #22
0
 /// <summary>Applies a key-generating function to each element of a CloudFlow and return a CloudFlow yielding unique keys and the result of the threading an accumulator.</summary>
 /// <param name="projection">A function to transform items from the input CloudFlow to keys.</param>
 /// <param name="folder">A function that updates the state with each element from the CloudFlow.</param>
 /// <param name="combiner">A function that combines partial states into a new state.</param>
 /// <param name="state">A function that produces the initial state.</param>
 /// <param name="stream">The input CloudFlow.</param>
 /// <returns>The final result.</returns>
 public static CloudFlow <Tuple <TKey, TAccumulate> > AggregateBy <TSource, TKey, TAccumulate>(this CloudFlow <TSource> stream, Func <TSource, TKey> projection, Func <TAccumulate> state, Func <TAccumulate, TSource, TAccumulate> folder, Func <TAccumulate, TAccumulate, TAccumulate> combiner)
 {
     return(CSharpProxy.AggregateBy(stream, projection, state, folder, combiner));
 }
Example #23
0
 /// <summary>Applies a specified function to the corresponding elements of two streams, producing a stream of the results.</summary>
 /// <param name="resultSelector">The combiner function.</param>
 /// <param name="first">The first input stream.</param>
 /// <param name="second">The second input stream.</param>
 /// <returns>The result stream.</returns>
 public static Stream<TResult> Zip<TFirst, TSecond, TResult>(this Stream<TFirst> first, Stream<TSecond> second, Func<TFirst, TSecond, TResult> resultSelector)
 {
     return CSharpProxy.Zip(first, second, resultSelector);
 }
Example #24
0
 /// <summary>Returns the sum of the elements.</summary>
 /// <param name="stream">The input stream.</param>
 /// <returns>The sum of the elements.</returns>
 public static long Sum(this Stream<long> stream)
 {
     return CSharpProxy.Sum(stream);
 }
Example #25
0
 /// <summary>Transforms each element of the input stream to a new stream and flattens its elements.</summary>
 /// <param name="f">A function to transform items from the input stream.</param>
 /// <param name="stream">The input stream.</param>
 /// <returns>The result stream.</returns>
 public static Stream<TResult> SelectMany<TSource, TResult>(this Stream<TSource> stream, Func<TSource, Stream<TResult>> f)
 {
     return CSharpProxy.SelectMany(stream, f);
 }
Example #26
0
 /// <summary>Returns the sum of the elements.</summary>
 /// <param name="stream">The input stream.</param>
 /// <returns>The sum of the elements.</returns>
 public static float Sum(this Stream<float> stream)
 {
     return CSharpProxy.Sum(stream);
 }
Example #27
0
 /// <summary>Applies a key-generating function to each element of the input stream and yields a stream ordered by keys. </summary>
 /// <param name="projection">A function to transform items of the input stream into comparable keys.</param>
 /// <param name="stream">The input stream.</param>
 /// <returns>The result stream.</returns>
 public static Stream<TSource> OrderBy<TSource, TKey>(this Stream<TSource> stream, Func<TSource, TKey> projection) where TKey : IComparable<TKey>
 {
     return CSharpProxy.OrderBy(stream, projection);
 }
Example #28
0
 /// <summary>Returns the sum of the elements.</summary>
 /// <param name="stream">The input stream.</param>
 /// <returns>The sum of the elements.</returns>
 public static double Sum(this Stream<double> stream)
 {
     return CSharpProxy.Sum(stream);
 }
Example #29
0
 /// <summary>Returns the sum of the elements.</summary>
 /// <param name="stream">The input stream.</param>
 /// <returns>The sum of the elements.</returns>
 public static int Sum(this Stream<int> stream)
 {
     return CSharpProxy.Sum(stream);
 }
Example #30
0
 /// <summary>Tests if any element of the stream satisfies the given predicate.</summary>
 /// <param name="predicate">A function to test each source element for a condition.</param>
 /// <param name="stream">The input stream.</param>
 /// <returns>true if any element satisfies the predicate. Otherwise, returns false.</returns>
 public static bool Any <TSource>(this Stream <TSource> stream, Func <TSource, bool> predicate)
 {
     return(CSharpProxy.Any(stream, predicate));
 }