From 4a96c2577999990a19d1553e7b8f67586dc5e0b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franz=20Wilhelmst=C3=B6tter?= Date: Thu, 12 Sep 2024 19:47:36 +0200 Subject: [PATCH] #909: Rename 'ArrayConversions' to 'Conversions'. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Franz Wilhelmstötter --- .../{ArrayConversions.java => Conversions.java} | 16 ++++++++-------- ...ConversionsTest.java => ConversionsTest.java} | 14 +++++++------- 2 files changed, 15 insertions(+), 15 deletions(-) rename jenetics/src/main/java/io/jenetics/util/{ArrayConversions.java => Conversions.java} (97%) rename jenetics/src/test/java/io/jenetics/util/{ArrayConversionsTest.java => ConversionsTest.java} (84%) diff --git a/jenetics/src/main/java/io/jenetics/util/ArrayConversions.java b/jenetics/src/main/java/io/jenetics/util/Conversions.java similarity index 97% rename from jenetics/src/main/java/io/jenetics/util/ArrayConversions.java rename to jenetics/src/main/java/io/jenetics/util/Conversions.java index 582237079f..3214f41f5c 100644 --- a/jenetics/src/main/java/io/jenetics/util/ArrayConversions.java +++ b/jenetics/src/main/java/io/jenetics/util/Conversions.java @@ -33,19 +33,19 @@ * This class contains methods for converting from and to the primitive arrays * {@code int[]}, {@code long[]} and {@code double[]}. Its main usage is to * unify numerical gene codecs, e.g.: - * {@snippet lang=java: + * {@snippet lang = java: * final Codec codec = Codecs * .ofVector(DoubleRange.of(0, 100), 100) - * .map(ArrayConversions::doubleToIntArray); - * } + * .map(Conversions::doubleToIntArray); + *} * * @author Franz Wilhelmstötter * @version !__version__! * @since !__version__! */ -public class ArrayConversions { +public class Conversions { - private ArrayConversions() { + private Conversions() { } /** @@ -250,11 +250,11 @@ public static int[] doubleToIntArray( /** * Return an array mapper function which applies the given {@code mapper} to * every array element. - * {@snippet lang=java: + * {@snippet lang = java: * final Codec codec = Codecs * .ofVector(DoubleRange.of(0, 100), 100) - * .map(ArrayConversions.doubleToIntArray(v -> (int)Math.round(v))); - * } + * .map(Conversions.doubleToIntArray(v -> (int)Math.round(v))); + *} * * @param mapper the array element mapper * @return an array mapper function diff --git a/jenetics/src/test/java/io/jenetics/util/ArrayConversionsTest.java b/jenetics/src/test/java/io/jenetics/util/ConversionsTest.java similarity index 84% rename from jenetics/src/test/java/io/jenetics/util/ArrayConversionsTest.java rename to jenetics/src/test/java/io/jenetics/util/ConversionsTest.java index 8ba7bc824f..6d50b10493 100644 --- a/jenetics/src/test/java/io/jenetics/util/ArrayConversionsTest.java +++ b/jenetics/src/test/java/io/jenetics/util/ConversionsTest.java @@ -29,14 +29,14 @@ * * @author Franz Wilhelmstötter */ -public class ArrayConversionsTest { +public class ConversionsTest { @Test public void intToLongArray() { final var source = new int[100]; Arrays.fill(source, 50); - final var target = ArrayConversions.intToLongArray(source); + final var target = Conversions.intToLongArray(source); for (int i = 0; i < source.length; ++i) { assertThat(target[i]).isEqualTo(source[i]); } @@ -47,7 +47,7 @@ public void intToDoubleArray() { final var source = new int[100]; Arrays.fill(source, 50); - final var target = ArrayConversions.intToDoubleArray(source); + final var target = Conversions.intToDoubleArray(source); for (int i = 0; i < source.length; ++i) { assertThat(target[i]).isEqualTo(source[i]); } @@ -58,7 +58,7 @@ public void longToIntArray() { final var source = new long[100]; Arrays.fill(source, 50); - final var target = ArrayConversions.longToIntArray(source); + final var target = Conversions.longToIntArray(source); for (int i = 0; i < source.length; ++i) { assertThat(target[i]).isEqualTo(source[i]); } @@ -69,7 +69,7 @@ public void longToDoubleArray() { final var source = new long[100]; Arrays.fill(source, 50); - final var target = ArrayConversions.longToDoubleArray(source); + final var target = Conversions.longToDoubleArray(source); for (int i = 0; i < source.length; ++i) { assertThat(target[i]).isEqualTo(source[i]); } @@ -80,7 +80,7 @@ public void doubleToIntArray() { final var source = new double[100]; Arrays.fill(source, 50); - final var target = ArrayConversions.doubleToIntArray(source); + final var target = Conversions.doubleToIntArray(source); for (int i = 0; i < source.length; ++i) { assertThat(target[i]).isEqualTo((int)source[i]); } @@ -91,7 +91,7 @@ public void doubleToLongArray() { final var source = new double[100]; Arrays.fill(source, 50); - final var target = ArrayConversions.doubleToLongArray(source); + final var target = Conversions.doubleToLongArray(source); for (int i = 0; i < source.length; ++i) { assertThat(target[i]).isEqualTo((long)source[i]); }