/src/Otis/IAggregateFunction.cs
http://otis-lib.googlecode.com/ · C# · 40 lines · 13 code · 5 blank · 22 comment · 0 complexity · 1971c66c09f4012935708b7d9634e6f4 MD5 · raw file
- using System;
- using System.Collections.Generic;
- using System.Text;
-
- namespace Otis
- {
- /// <summary>
- /// Interface implemented by all aggregate functions which can be executed
- /// on path expressions
- /// </summary>
- /// <remarks>
- /// Client applications can implement additional functions by extending this interface
- /// and registering those classes with <see cref="Configuration"/>.
- /// </remarks>
- public interface IAggregateFunction<T> : IExpressionFormatProvider
- {
- /// <summary>
- /// Sets the starting value of the function
- /// </summary>
- /// <param name="initialValue">Initial value</param>
- void Initialize(T initialValue);
-
- /// <summary>
- /// Updates the function with specified value
- /// </summary>
- /// <param name="value">New value to be processed</param>
- void ProcessValue(T value);
-
- /// <summary>
- /// returns the number of items processed by the function
- /// </summary>
- int ProcessedItemCount { get; }
-
- /// <summary>
- /// Returns the current function result
- /// </summary>
- T Result { get; }
-
- }
- }