/src/Otis/Functions/MinFunction.cs

http://otis-lib.googlecode.com/ · C# · 21 lines · 18 code · 2 blank · 1 comment · 0 complexity · 7cf78166e81dc976a8c1fa61f15d2b1d MD5 · raw file

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using Otis.CodeGen;
  5. namespace Otis.Functions
  6. {
  7. public class MinFunction : MinMaxFunctionBase
  8. {
  9. protected override string GetFormatForExecutedExpression(AggregateFunctionContext context)
  10. {
  11. // todo: test
  12. return "if(CURR_ITEM < FN_OBJ) FN_OBJ = CURR_ITEM;";
  13. }
  14. protected override string GetFieldNameForInitialValue()
  15. {
  16. return "MaxValue";
  17. }
  18. }
  19. }