private void updateCurrentAndNextSectionOfBuffer ( int i ) { int next = iterators . length + i ; timestamps [ i ] = timestamps [ next ] ; values [ i ] = values [ next ] ; if ( iterators [ i ] . hasNext ( ) ) { putDataPoint ( next , ( Entry < Long , Double > ) iterators [ i ] . next ( ) ) ; } else { markEndTimeSeries ( i ) ; } }
Makes iterator number i move forward to the next data point in internal buffer Copies the next datapoint to current datapoint and uses the iterator to populate the next section