/src/Otis/IAggregateFunction.cs

http://otis-lib.googlecode.com/ · C# · 40 lines · 13 code · 5 blank · 22 comment · 0 complexity · 1971c66c09f4012935708b7d9634e6f4 MD5 · raw file

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