test_class.file: contrib/src/test/java/macrobase/analysis/transform/aggregate/BatchWindowMaxTest.java
test_class.identifier: BatchWindowMaxTest
test_case.body: @Test
      public void testAggregate() throws Exception {
          Random r = new Random(0);
          List<Datum> data = new ArrayList<>();
          for (int i = 0; i < 10; i ++) {
              Datum d = new Datum(new ArrayList<>(), new ArrayRealVector(3));
              d.metrics().setEntry(0, 1);
              if (i == 0) {
                  d.metrics().setEntry(1, r.nextInt());
              } else {
                  d.metrics().setEntry(1, Integer.MAX_VALUE);
              }
              d.metrics().setEntry(2, i);
              data.add(d);
          }
  
          BatchWindowMax windowMax = new BatchWindowMax();
          Datum max = windowMax.aggregate(data);
          assert(max.metrics().getEntry(0) == 1);
          assert(max.metrics().getEntry(1) == Integer.MAX_VALUE);
          assert(max.metrics().getEntry(2) == 9);
  
          /* Test datum with time column */
          MacroBaseConf conf = new MacroBaseConf().set(MacroBaseConf.TIME_COLUMN, 2);
          windowMax = new BatchWindowMax(conf);
          max = windowMax.aggregate(data);
          assert(max.metrics().getEntry(0) == 1);
          assert(max.metrics().getEntry(1) == Integer.MAX_VALUE);
      }
test_case.class_method_signature: BatchWindowMaxTest.testAggregate()
test_case.full_signature: @Test public void testAggregate()
test_case.identifier: testAggregate
test_case.invocations: setEntry metrics setEntry metrics nextInt setEntry metrics setEntry metrics add aggregate getEntry metrics getEntry metrics getEntry metrics set aggregate getEntry metrics getEntry metrics
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testAggregate()
focal_class.file: contrib/src/main/java/macrobase/analysis/transform/aggregate/BatchWindowMax.java
focal_class.identifier: BatchWindowMax
focal_class.class_method_signature: BatchWindowMax.BatchWindowMax()
focal_class.full_signature: public  BatchWindowMax()
focal_class.identifier: BatchWindowMax
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  BatchWindowMax()
focal_class.class_method_signature: BatchWindowMax.BatchWindowMax(MacroBaseConf conf)
focal_class.full_signature: public  BatchWindowMax(MacroBaseConf conf)
focal_class.identifier: BatchWindowMax
focal_class.modifiers: public
focal_class.parameters: (MacroBaseConf conf)
focal_class.signature:  BatchWindowMax(MacroBaseConf conf)
focal_class.class_method_signature: BatchWindowMax.aggregate(List<Datum> data)
focal_class.full_signature: public Datum aggregate(List<Datum> data)
focal_class.identifier: aggregate
focal_class.modifiers: public
focal_class.parameters: (List<Datum> data)
focal_class.return: Datum
focal_class.signature: Datum aggregate(List<Datum> data)
focal_class.superclass: extends BatchWindowAggregate
focal_method.body: public Datum aggregate(List<Datum> data) {
          if (data.isEmpty())
              return new Datum(new ArrayList<>(), new ArrayRealVector(dim));
  
          dim = data.get(0).metrics().getDimension();
          RealVector results = new ArrayRealVector(dim);
          results.set(Double.MIN_VALUE);
  
          for (Datum d : data) {
              RealVector metrics = d.metrics();
              for (int i = 0; i < dim; i ++) {
                  if (timeColumn != null && i == timeColumn)
                      continue;
                  results.setEntry(i, Math.max(results.getEntry(i), metrics.getEntry(i)));
              }
          }
  
          return new Datum(new ArrayList<>(), results);
      }
focal_method.class_method_signature: BatchWindowMax.aggregate(List<Datum> data)
focal_method.full_signature: public Datum aggregate(List<Datum> data)
focal_method.identifier: aggregate
focal_method.invocations: isEmpty getDimension metrics get set metrics setEntry max getEntry getEntry
focal_method.modifiers: public
focal_method.parameters: (List<Datum> data)
focal_method.return: Datum
focal_method.signature: Datum aggregate(List<Datum> data)