From 51bc893bc5ac99a2234403d9eb955a88e103a4b9 Mon Sep 17 00:00:00 2001 From: ysthakur <45539777+ysthakur@users.noreply.github.com> Date: Mon, 25 Apr 2022 17:58:12 -0400 Subject: [PATCH] [wpiutil] CircularBuffer: Change Java package-private methods to public (#4181) The `size`, `getFirst`, `getLast`, and `resize` methods were all package-private. Also make `size` return an `int` instead of a `double`. --- .../src/main/java/edu/wpi/first/util/CircularBuffer.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wpiutil/src/main/java/edu/wpi/first/util/CircularBuffer.java b/wpiutil/src/main/java/edu/wpi/first/util/CircularBuffer.java index f9129c7ec1..f8ce8372b1 100644 --- a/wpiutil/src/main/java/edu/wpi/first/util/CircularBuffer.java +++ b/wpiutil/src/main/java/edu/wpi/first/util/CircularBuffer.java @@ -31,7 +31,7 @@ public class CircularBuffer { * * @return number of elements in buffer */ - double size() { + public int size() { return m_length; } @@ -40,7 +40,7 @@ public class CircularBuffer { * * @return value at front of buffer */ - double getFirst() { + public double getFirst() { return m_data[m_front]; } @@ -49,7 +49,7 @@ public class CircularBuffer { * * @return value at back of buffer */ - double getLast() { + public double getLast() { // If there are no elements in the buffer, do nothing if (m_length == 0) { return 0.0; @@ -138,7 +138,7 @@ public class CircularBuffer { * * @param size New buffer size. */ - void resize(int size) { + public void resize(int size) { double[] newBuffer = new double[size]; m_length = Math.min(m_length, size); for (int i = 0; i < m_length; i++) {