From 3ffb001c7359a1e1d2ac14869ca3c2796ddbf363 Mon Sep 17 00:00:00 2001 From: Speiger Date: Fri, 8 Apr 2022 00:13:51 +0200 Subject: [PATCH] More fixes -Fixed: More javadoc fixes -Fixed: BaseIntIterableTest no longer uses a deprecated function --- .../collections/templates/functions/Comparator.template | 4 ++++ .../assets/collections/templates/lists/ArrayList.template | 2 +- .../collections/templates/maps/interfaces/SortedMap.template | 5 +++++ .../src/collections/ints/base/BaseIntIterableTest.java | 4 ++-- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/builder/resources/speiger/assets/collections/templates/functions/Comparator.template b/src/builder/resources/speiger/assets/collections/templates/functions/Comparator.template index 124c030b..870ec5f5 100644 --- a/src/builder/resources/speiger/assets/collections/templates/functions/Comparator.template +++ b/src/builder/resources/speiger/assets/collections/templates/functions/Comparator.template @@ -50,6 +50,10 @@ public interface COMPARATOR extends Comparator { COMPARATOR original; + /** + * default constructor + * @param original that is going to be reversed + */ public Reversed(COMPARATOR original) { this.original = original; } diff --git a/src/builder/resources/speiger/assets/collections/templates/lists/ArrayList.template b/src/builder/resources/speiger/assets/collections/templates/lists/ArrayList.template index 366bed17..9d8aa8c6 100644 --- a/src/builder/resources/speiger/assets/collections/templates/lists/ArrayList.template +++ b/src/builder/resources/speiger/assets/collections/templates/lists/ArrayList.template @@ -193,7 +193,7 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE * Appends the specified element to the end of this list. * * @param e element to be appended to this list - * @return true (as specified by {@link Collection#add}) + * @return true (as specified by {@link Collection#add}) */ @Override public boolean add(KEY_TYPE e) { diff --git a/src/builder/resources/speiger/assets/collections/templates/maps/interfaces/SortedMap.template b/src/builder/resources/speiger/assets/collections/templates/maps/interfaces/SortedMap.template index eb07cce4..a720ad38 100644 --- a/src/builder/resources/speiger/assets/collections/templates/maps/interfaces/SortedMap.template +++ b/src/builder/resources/speiger/assets/collections/templates/maps/interfaces/SortedMap.template @@ -227,6 +227,11 @@ public interface SORTED_MAP KEY_VALUE_GENERIC_TYPE extends SortedMap { @Override public ObjectBidirectionalIterator fastIterator(); + /** + * Fast iterator that recycles the given Entry object to improve speed and reduce object allocation + * @param fromElement that is going to be started from. + * @return a improved iterator that starts from the desired element + */ public ObjectBidirectionalIterator fastIterator(KEY_TYPE fromElement); } } \ No newline at end of file diff --git a/src/test/java/speiger/src/collections/ints/base/BaseIntIterableTest.java b/src/test/java/speiger/src/collections/ints/base/BaseIntIterableTest.java index e29bf9c4..946d1e5e 100644 --- a/src/test/java/speiger/src/collections/ints/base/BaseIntIterableTest.java +++ b/src/test/java/speiger/src/collections/ints/base/BaseIntIterableTest.java @@ -123,8 +123,8 @@ public abstract class BaseIntIterableTest @Test public void testStreamMap() { if(getValidIterableTests().contains(IterableTest.STREAM_MAP)) { - Integer[] expected = IntStream.of(TEST_ARRAY).mapToObj(Integer::new).toArray(Integer[]::new); - Integer[] actual = ObjectIterators.pour(create(TEST_ARRAY).map(Integer::new).iterator()).toArray(Integer[]::new); + Integer[] expected = IntStream.of(TEST_ARRAY).mapToObj(Integer::valueOf).toArray(Integer[]::new); + Integer[] actual = ObjectIterators.pour(create(TEST_ARRAY).map(Integer::valueOf).iterator()).toArray(Integer[]::new); ObjectArrays.stableSort(actual); Assert.assertArrayEquals(expected, actual); }