test_class.file: dataprep-transformation/src/test/java/org/talend/dataprep/transformation/aggregation/operation/AverageTest.java
test_class.identifier: AverageTest
test_class.superclass: extends OperationBaseTest
test_case.body: @Test
      public void shouldComputeAverage() {
  
          AggregationResult result = new AggregationResult(Operator.AVERAGE);
          aggregator.accept(getRow("toto", "10"), result);
          aggregator.accept(getRow("toto", "2"), result);
          aggregator.accept(getRow("toto", "3.6"), result);
          aggregator.accept(getRow("toto", ""), result);
          aggregator.accept(getRow("toto", "8.2"), result);
          aggregator.accept(getRow("tata", "10"), result);
          aggregator.accept(getRow("toto", "-8"), result);
          aggregator.accept(getRow("toto", "12.3"), result);
          aggregator.accept(getRow("tata", "5"), result);
  
          final Average.AverageContext toto = (Average.AverageContext) result.get("toto");
          assertEquals(4.683d, toto.getValue(), 0.001d);
  
          final Average.AverageContext tata = (Average.AverageContext) result.get("tata");
          assertEquals(7.5d, tata.getValue(), 0);
  
      }
test_case.class_method_signature: AverageTest.shouldComputeAverage()
test_case.full_signature: @Test public void shouldComputeAverage()
test_case.identifier: shouldComputeAverage
test_case.invocations: accept getRow accept getRow accept getRow accept getRow accept getRow accept getRow accept getRow accept getRow accept getRow get assertEquals getValue get assertEquals getValue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void shouldComputeAverage()
focal_class.file: dataprep-transformation/src/main/java/org/talend/dataprep/transformation/aggregation/operation/Average.java
focal_class.identifier: Average
focal_class.interfaces: implements Aggregator
focal_class.class_method_signature: Average.Average(String groupBy, String columnId)
focal_class.full_signature:   Average(String groupBy, String columnId)
focal_class.identifier: Average
focal_class.parameters: (String groupBy, String columnId)
focal_class.signature:  Average(String groupBy, String columnId)
focal_class.class_method_signature: Average.accept(DataSetRow row, AggregationResult result)
focal_class.full_signature: @Override public void accept(DataSetRow row, AggregationResult result)
focal_class.identifier: accept
focal_class.modifiers: @Override public
focal_class.parameters: (DataSetRow row, AggregationResult result)
focal_class.return: void
focal_class.signature: void accept(DataSetRow row, AggregationResult result)
focal_class.class_method_signature: Average.normalize(AggregationResult result)
focal_class.full_signature: @Override public void normalize(AggregationResult result)
focal_class.identifier: normalize
focal_class.modifiers: @Override public
focal_class.parameters: (AggregationResult result)
focal_class.return: void
focal_class.signature: void normalize(AggregationResult result)
focal_class.superclass: extends AbstractAggregator
focal_method.body: @Override
      public void accept(DataSetRow row, AggregationResult result) {
          final String key = row.get(groupBy);
  
          // init the group by in the result
          if (!result.contains(key)) {
              result.put(key, new AverageContext());
          }
  
          final AverageContext context = (AverageContext) result.get(key);
          context.process(row.get(columnId));
      }
focal_method.class_method_signature: Average.accept(DataSetRow row, AggregationResult result)
focal_method.full_signature: @Override public void accept(DataSetRow row, AggregationResult result)
focal_method.identifier: accept
focal_method.invocations: get contains put get process get
focal_method.modifiers: @Override public
focal_method.parameters: (DataSetRow row, AggregationResult result)
focal_method.return: void
focal_method.signature: void accept(DataSetRow row, AggregationResult result)