PageRenderTime 186ms CodeModel.GetById 179ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/src/Otis/IAggregateFunction.cs

http://otis-lib.googlecode.com/
C# | 40 lines | 13 code | 5 blank | 22 comment | 0 complexity | 1971c66c09f4012935708b7d9634e6f4 MD5 | raw file
 1using System;
 2using System.Collections.Generic;
 3using System.Text;
 4
 5namespace Otis
 6{
 7	/// <summary>
 8	/// Interface implemented by all aggregate functions which can be executed
 9	/// on path expressions
10	/// </summary>
11	/// <remarks>
12	/// Client applications can implement additional functions by extending this interface
13	/// and registering those classes with <see cref="Configuration"/>.
14	/// </remarks>
15	public interface IAggregateFunction<T> : IExpressionFormatProvider
16	{
17		/// <summary>
18		/// Sets the starting value of the function
19		/// </summary>
20		/// <param name="initialValue">Initial value</param>
21		void Initialize(T initialValue);
22
23		/// <summary>
24		/// Updates the function with specified value
25		/// </summary>
26		/// <param name="value">New value to be processed</param>
27		void ProcessValue(T value);
28
29		/// <summary>
30		/// returns the number of items processed by the function
31		/// </summary>
32		int ProcessedItemCount { get; }
33
34		/// <summary>
35		/// Returns the current function result
36		/// </summary>
37		T Result { get; }
38
39	}
40}