Renamed DoubleBuffer to DoubleRingBuffer.

This commit is contained in:
Dennis Guse
2020-04-10 22:34:27 +02:00
parent 9d6c9676ab
commit 01ee1a1e49
2 changed files with 5 additions and 5 deletions
@@ -19,13 +19,13 @@ package de.dennisguse.opentracks.stats;
import androidx.annotation.NonNull;
/**
* This class maintains a buffer of doubles.
* This class maintains a ring buffer of doubles.
* This buffer is a convenient class for storing a series of doubles and calculating information about them.
* This is a FIFO buffer.
*
* @author Sandor Dornbush
*/
class DoubleBuffer {
class DoubleRingBuffer {
// The sliding buffer of doubles.
private final double[] buffer;
@@ -41,7 +41,7 @@ class DoubleBuffer {
*
* @param size the size
*/
DoubleBuffer(int size) {
DoubleRingBuffer(int size) {
if (size < 1) {
throw new IllegalArgumentException("The buffer size must be greater than 1.");
}
@@ -62,9 +62,9 @@ public class TrackStatisticsUpdater {
private final TrackStatistics trackStatistics;
// A buffer of the recent elevation readings (m)
private final DoubleBuffer elevationBuffer_m = new DoubleBuffer(ELEVATION_SMOOTHING_FACTOR);
private final DoubleRingBuffer elevationBuffer_m = new DoubleRingBuffer(ELEVATION_SMOOTHING_FACTOR);
// A buffer of the recent speed readings (m/s) for calculating max speed
private final DoubleBuffer speedBuffer_ms = new DoubleBuffer(SPEED_SMOOTHING_FACTOR);
private final DoubleRingBuffer speedBuffer_ms = new DoubleRingBuffer(SPEED_SMOOTHING_FACTOR);
// The current segment's statistics
private TrackStatistics currentSegment;