test_class.declarator: stream
test_class.modifier: private static
test_class.original_string: private static TimeDatumStream stream;
test_class.type: TimeDatumStream
test_class.var_name: stream
test_class.declarator: conf = new MacroBaseConf()
test_class.modifier: private static
test_class.original_string: private static MacroBaseConf conf = new MacroBaseConf();
test_class.type: MacroBaseConf
test_class.var_name: conf
test_class.declarator: data = new ArrayList<>()
test_class.modifier: private static
test_class.original_string: private static List<Datum> data = new ArrayList<>();
test_class.type: List<Datum>
test_class.var_name: data
test_class.file: contrib/src/test/java/macrobase/analysis/pipeline/stream/TimeDatumStreamTest.java
test_class.identifier: TimeDatumStreamTest
test_case.body: @Test
      public void testDrainDuration() {
          conf.set(MacroBaseConf.TIME_COLUMN, 0);
  
          for (int i = 0; i < 100; ++i) {
              Datum d = TestUtils.createTimeDatum(2 * i, 100 - i);
              data.add(d);
          }
  
          stream = new TimeDatumStream(data, 0);
          List<Datum> result = stream.drainDuration(1);
          assertTrue(result.size() == 1);
          result = stream.drainDuration(100);
          assertTrue(result.size() == 50);
          result = stream.drainDuration(200);
          assertTrue(result.size() == 49);
      }
test_case.class_method_signature: TimeDatumStreamTest.testDrainDuration()
test_case.full_signature: @Test public void testDrainDuration()
test_case.identifier: testDrainDuration
test_case.invocations: set createTimeDatum add drainDuration assertTrue size drainDuration assertTrue size drainDuration assertTrue size
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testDrainDuration()
focal_class.declarator: timeColumn
focal_class.modifier: private
focal_class.original_string: private int timeColumn;
focal_class.type: int
focal_class.var_name: timeColumn
focal_class.file: contrib/src/main/java/macrobase/analysis/pipeline/stream/TimeDatumStream.java
focal_class.identifier: TimeDatumStream
focal_class.class_method_signature: TimeDatumStream.TimeDatumStream(int timeColumn)
focal_class.full_signature: public  TimeDatumStream(int timeColumn)
focal_class.identifier: TimeDatumStream
focal_class.modifiers: public
focal_class.parameters: (int timeColumn)
focal_class.signature:  TimeDatumStream(int timeColumn)
focal_class.class_method_signature: TimeDatumStream.TimeDatumStream(List<Datum> data, int timeColumn)
focal_class.full_signature: public  TimeDatumStream(List<Datum> data, int timeColumn)
focal_class.identifier: TimeDatumStream
focal_class.modifiers: public
focal_class.parameters: (List<Datum> data, int timeColumn)
focal_class.signature:  TimeDatumStream(List<Datum> data, int timeColumn)
focal_class.class_method_signature: TimeDatumStream.getDatumTime(int i)
focal_class.full_signature: private long getDatumTime(int i)
focal_class.identifier: getDatumTime
focal_class.modifiers: private
focal_class.parameters: (int i)
focal_class.return: long
focal_class.signature: long getDatumTime(int i)
focal_class.class_method_signature: TimeDatumStream.drainDuration(long duration)
focal_class.full_signature: public List<Datum> drainDuration(long duration)
focal_class.identifier: drainDuration
focal_class.modifiers: public
focal_class.parameters: (long duration)
focal_class.return: List<Datum>
focal_class.signature: List<Datum> drainDuration(long duration)
focal_class.class_method_signature: TimeDatumStream.peek()
focal_class.full_signature: public Datum peek()
focal_class.identifier: peek
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Datum
focal_class.signature: Datum peek()
focal_class.superclass: extends MBStream<Datum>
focal_method.body: public List<Datum> drainDuration(long duration) {
          int i = 0;
          long startTime = getDatumTime(i);
          while (i < output.size() && getDatumTime(i) - startTime < duration) {
              i ++;
          }
          return drain(i);
      }
focal_method.class_method_signature: TimeDatumStream.drainDuration(long duration)
focal_method.full_signature: public List<Datum> drainDuration(long duration)
focal_method.identifier: drainDuration
focal_method.invocations: getDatumTime size getDatumTime drain
focal_method.modifiers: public
focal_method.parameters: (long duration)
focal_method.return: List<Datum>
focal_method.signature: List<Datum> drainDuration(long duration)