From f2c6d26c8289abc6e04405d7d5dc661ff8266f39 Mon Sep 17 00:00:00 2001 From: Jagath Kumar <1611881-jagathks@users.noreply.gitlab.com> Date: Tue, 9 Apr 2024 20:04:24 +0530 Subject: [PATCH] calculating Moving averages - package updated --- .../algorithms-miscellaneous-8/pom.xml | 10 ++++++- .../ExponentialMovingAverage.java | 2 +- .../MovingAverageByCircularBuffer.java | 2 +- .../MovingAverageWithApacheCommonsMath.java | 2 +- .../MovingAverageWithStreamBasedApproach.java | 2 +- .../ExponentialMovingAverageUnitTest.java | 5 ++-- ...MovingAverageByCircularBufferUnitTest.java | 3 ++- ...gAverageWithApacheCommonsMathUnitTest.java | 3 ++- ...verageWithStreamBasedApproachUnitTest.java | 4 +-- .../algorithms-miscellaneous-9/pom.xml | 27 ------------------- algorithms-modules/pom.xml | 2 +- 11 files changed, 23 insertions(+), 39 deletions(-) rename algorithms-modules/{algorithms-miscellaneous-9/src/main/java/com/baeldung => algorithms-miscellaneous-8/src/main/java/com/baeldung/movingaverages}/ExponentialMovingAverage.java (94%) rename algorithms-modules/{algorithms-miscellaneous-9/src/main/java/com/baeldung => algorithms-miscellaneous-8/src/main/java/com/baeldung/movingaverages}/MovingAverageByCircularBuffer.java (94%) rename algorithms-modules/{algorithms-miscellaneous-9/src/main/java/com/baeldung => algorithms-miscellaneous-8/src/main/java/com/baeldung/movingaverages}/MovingAverageWithApacheCommonsMath.java (92%) rename algorithms-modules/{algorithms-miscellaneous-9/src/main/java/com/baeldung => algorithms-miscellaneous-8/src/main/java/com/baeldung/movingaverages}/MovingAverageWithStreamBasedApproach.java (93%) rename algorithms-modules/{algorithms-miscellaneous-9/src/test/java/com/baeldung => algorithms-miscellaneous-8/src/test/java/com/baeldung/movingaverages}/ExponentialMovingAverageUnitTest.java (97%) rename algorithms-modules/{algorithms-miscellaneous-9/src/test/java/com/baeldung => algorithms-miscellaneous-8/src/test/java/com/baeldung/movingaverages}/MovingAverageByCircularBufferUnitTest.java (96%) rename algorithms-modules/{algorithms-miscellaneous-9/src/test/java/com/baeldung => algorithms-miscellaneous-8/src/test/java/com/baeldung/movingaverages}/MovingAverageWithApacheCommonsMathUnitTest.java (97%) rename algorithms-modules/{algorithms-miscellaneous-9/src/test/java/com/baeldung => algorithms-miscellaneous-8/src/test/java/com/baeldung/movingaverages}/MovingAverageWithStreamBasedApproachUnitTest.java (93%) delete mode 100644 algorithms-modules/algorithms-miscellaneous-9/pom.xml diff --git a/algorithms-modules/algorithms-miscellaneous-8/pom.xml b/algorithms-modules/algorithms-miscellaneous-8/pom.xml index 29163c5de7..860c0889c8 100644 --- a/algorithms-modules/algorithms-miscellaneous-8/pom.xml +++ b/algorithms-modules/algorithms-miscellaneous-8/pom.xml @@ -13,4 +13,12 @@ 1.0.0-SNAPSHOT - + + + + org.apache.commons + commons-math3 + ${commons-math3.version} + + + \ No newline at end of file diff --git a/algorithms-modules/algorithms-miscellaneous-9/src/main/java/com/baeldung/ExponentialMovingAverage.java b/algorithms-modules/algorithms-miscellaneous-8/src/main/java/com/baeldung/movingaverages/ExponentialMovingAverage.java similarity index 94% rename from algorithms-modules/algorithms-miscellaneous-9/src/main/java/com/baeldung/ExponentialMovingAverage.java rename to algorithms-modules/algorithms-miscellaneous-8/src/main/java/com/baeldung/movingaverages/ExponentialMovingAverage.java index d183e689c4..22e7f56efe 100644 --- a/algorithms-modules/algorithms-miscellaneous-9/src/main/java/com/baeldung/ExponentialMovingAverage.java +++ b/algorithms-modules/algorithms-miscellaneous-8/src/main/java/com/baeldung/movingaverages/ExponentialMovingAverage.java @@ -1,4 +1,4 @@ -package com.baeldung; +package com.baeldung.movingaverages; public class ExponentialMovingAverage { diff --git a/algorithms-modules/algorithms-miscellaneous-9/src/main/java/com/baeldung/MovingAverageByCircularBuffer.java b/algorithms-modules/algorithms-miscellaneous-8/src/main/java/com/baeldung/movingaverages/MovingAverageByCircularBuffer.java similarity index 94% rename from algorithms-modules/algorithms-miscellaneous-9/src/main/java/com/baeldung/MovingAverageByCircularBuffer.java rename to algorithms-modules/algorithms-miscellaneous-8/src/main/java/com/baeldung/movingaverages/MovingAverageByCircularBuffer.java index 5136e1e38d..2b748382c6 100644 --- a/algorithms-modules/algorithms-miscellaneous-9/src/main/java/com/baeldung/MovingAverageByCircularBuffer.java +++ b/algorithms-modules/algorithms-miscellaneous-8/src/main/java/com/baeldung/movingaverages/MovingAverageByCircularBuffer.java @@ -1,4 +1,4 @@ -package com.baeldung; +package com.baeldung.movingaverages; public class MovingAverageByCircularBuffer { diff --git a/algorithms-modules/algorithms-miscellaneous-9/src/main/java/com/baeldung/MovingAverageWithApacheCommonsMath.java b/algorithms-modules/algorithms-miscellaneous-8/src/main/java/com/baeldung/movingaverages/MovingAverageWithApacheCommonsMath.java similarity index 92% rename from algorithms-modules/algorithms-miscellaneous-9/src/main/java/com/baeldung/MovingAverageWithApacheCommonsMath.java rename to algorithms-modules/algorithms-miscellaneous-8/src/main/java/com/baeldung/movingaverages/MovingAverageWithApacheCommonsMath.java index 34e84e0a62..fea54a7874 100644 --- a/algorithms-modules/algorithms-miscellaneous-9/src/main/java/com/baeldung/MovingAverageWithApacheCommonsMath.java +++ b/algorithms-modules/algorithms-miscellaneous-8/src/main/java/com/baeldung/movingaverages/MovingAverageWithApacheCommonsMath.java @@ -1,4 +1,4 @@ -package com.baeldung; +package com.baeldung.movingaverages; import org.apache.commons.math3.stat.descriptive.DescriptiveStatistics; diff --git a/algorithms-modules/algorithms-miscellaneous-9/src/main/java/com/baeldung/MovingAverageWithStreamBasedApproach.java b/algorithms-modules/algorithms-miscellaneous-8/src/main/java/com/baeldung/movingaverages/MovingAverageWithStreamBasedApproach.java similarity index 93% rename from algorithms-modules/algorithms-miscellaneous-9/src/main/java/com/baeldung/MovingAverageWithStreamBasedApproach.java rename to algorithms-modules/algorithms-miscellaneous-8/src/main/java/com/baeldung/movingaverages/MovingAverageWithStreamBasedApproach.java index d89e3d9284..4d9331c7ec 100644 --- a/algorithms-modules/algorithms-miscellaneous-9/src/main/java/com/baeldung/MovingAverageWithStreamBasedApproach.java +++ b/algorithms-modules/algorithms-miscellaneous-8/src/main/java/com/baeldung/movingaverages/MovingAverageWithStreamBasedApproach.java @@ -1,4 +1,4 @@ -package com.baeldung; +package com.baeldung.movingaverages; import java.util.stream.DoubleStream; diff --git a/algorithms-modules/algorithms-miscellaneous-9/src/test/java/com/baeldung/ExponentialMovingAverageUnitTest.java b/algorithms-modules/algorithms-miscellaneous-8/src/test/java/com/baeldung/movingaverages/ExponentialMovingAverageUnitTest.java similarity index 97% rename from algorithms-modules/algorithms-miscellaneous-9/src/test/java/com/baeldung/ExponentialMovingAverageUnitTest.java rename to algorithms-modules/algorithms-miscellaneous-8/src/test/java/com/baeldung/movingaverages/ExponentialMovingAverageUnitTest.java index 26251095a8..8c1fe11ed3 100644 --- a/algorithms-modules/algorithms-miscellaneous-9/src/test/java/com/baeldung/ExponentialMovingAverageUnitTest.java +++ b/algorithms-modules/algorithms-miscellaneous-8/src/test/java/com/baeldung/movingaverages/ExponentialMovingAverageUnitTest.java @@ -1,7 +1,8 @@ -package com.baeldung; +package com.baeldung.movingaverages; + +import org.junit.Test; import static org.junit.Assert.assertEquals; -import org.junit.Test; public class ExponentialMovingAverageUnitTest { diff --git a/algorithms-modules/algorithms-miscellaneous-9/src/test/java/com/baeldung/MovingAverageByCircularBufferUnitTest.java b/algorithms-modules/algorithms-miscellaneous-8/src/test/java/com/baeldung/movingaverages/MovingAverageByCircularBufferUnitTest.java similarity index 96% rename from algorithms-modules/algorithms-miscellaneous-9/src/test/java/com/baeldung/MovingAverageByCircularBufferUnitTest.java rename to algorithms-modules/algorithms-miscellaneous-8/src/test/java/com/baeldung/movingaverages/MovingAverageByCircularBufferUnitTest.java index 4f641739b1..9b498ccf1c 100644 --- a/algorithms-modules/algorithms-miscellaneous-9/src/test/java/com/baeldung/MovingAverageByCircularBufferUnitTest.java +++ b/algorithms-modules/algorithms-miscellaneous-8/src/test/java/com/baeldung/movingaverages/MovingAverageByCircularBufferUnitTest.java @@ -1,6 +1,7 @@ -package com.baeldung; +package com.baeldung.movingaverages; import org.junit.Test; + import static org.junit.Assert.assertEquals; public class MovingAverageByCircularBufferUnitTest { diff --git a/algorithms-modules/algorithms-miscellaneous-9/src/test/java/com/baeldung/MovingAverageWithApacheCommonsMathUnitTest.java b/algorithms-modules/algorithms-miscellaneous-8/src/test/java/com/baeldung/movingaverages/MovingAverageWithApacheCommonsMathUnitTest.java similarity index 97% rename from algorithms-modules/algorithms-miscellaneous-9/src/test/java/com/baeldung/MovingAverageWithApacheCommonsMathUnitTest.java rename to algorithms-modules/algorithms-miscellaneous-8/src/test/java/com/baeldung/movingaverages/MovingAverageWithApacheCommonsMathUnitTest.java index fff884ec01..14ff7c15ee 100644 --- a/algorithms-modules/algorithms-miscellaneous-9/src/test/java/com/baeldung/MovingAverageWithApacheCommonsMathUnitTest.java +++ b/algorithms-modules/algorithms-miscellaneous-8/src/test/java/com/baeldung/movingaverages/MovingAverageWithApacheCommonsMathUnitTest.java @@ -1,6 +1,7 @@ -package com.baeldung; +package com.baeldung.movingaverages; import org.junit.Test; + import static org.junit.Assert.assertEquals; public class MovingAverageWithApacheCommonsMathUnitTest { diff --git a/algorithms-modules/algorithms-miscellaneous-9/src/test/java/com/baeldung/MovingAverageWithStreamBasedApproachUnitTest.java b/algorithms-modules/algorithms-miscellaneous-8/src/test/java/com/baeldung/movingaverages/MovingAverageWithStreamBasedApproachUnitTest.java similarity index 93% rename from algorithms-modules/algorithms-miscellaneous-9/src/test/java/com/baeldung/MovingAverageWithStreamBasedApproachUnitTest.java rename to algorithms-modules/algorithms-miscellaneous-8/src/test/java/com/baeldung/movingaverages/MovingAverageWithStreamBasedApproachUnitTest.java index bf8775e51a..ac2d1986d4 100644 --- a/algorithms-modules/algorithms-miscellaneous-9/src/test/java/com/baeldung/MovingAverageWithStreamBasedApproachUnitTest.java +++ b/algorithms-modules/algorithms-miscellaneous-8/src/test/java/com/baeldung/movingaverages/MovingAverageWithStreamBasedApproachUnitTest.java @@ -1,8 +1,8 @@ -package com.baeldung; +package com.baeldung.movingaverages; import org.junit.Test; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; public class MovingAverageWithStreamBasedApproachUnitTest { diff --git a/algorithms-modules/algorithms-miscellaneous-9/pom.xml b/algorithms-modules/algorithms-miscellaneous-9/pom.xml deleted file mode 100644 index cd44b17184..0000000000 --- a/algorithms-modules/algorithms-miscellaneous-9/pom.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - 4.0.0 - - com.baeldung - algorithms-modules - 1.0.0-SNAPSHOT - - - algorithms-miscellaneous-9 - - - 17 - 17 - UTF-8 - - - - - org.apache.commons - commons-math3 - ${commons-math3.version} - - - \ No newline at end of file diff --git a/algorithms-modules/pom.xml b/algorithms-modules/pom.xml index aaaac86b6d..1ddb61c66a 100644 --- a/algorithms-modules/pom.xml +++ b/algorithms-modules/pom.xml @@ -26,7 +26,7 @@ algorithms-searching algorithms-sorting algorithms-sorting-2 - algorithms-miscellaneous-9 + algorithms-miscellaneous-8