From bbcb29056079f93f999c5ffbd4713903a038c6f5 Mon Sep 17 00:00:00 2001 From: Speiger Date: Fri, 28 May 2021 20:20:45 +0200 Subject: [PATCH] List Documentation cleanup & added Primitive Parallel Streams --- .../collections/templates/collections/Collection.template | 5 +++++ .../assets/collections/templates/lists/ArrayList.template | 4 ---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/builder/resources/speiger/assets/collections/templates/collections/Collection.template b/src/builder/resources/speiger/assets/collections/templates/collections/Collection.template index e2bf47a9..190381ba 100644 --- a/src/builder/resources/speiger/assets/collections/templates/collections/Collection.template +++ b/src/builder/resources/speiger/assets/collections/templates/collections/Collection.template @@ -188,6 +188,11 @@ public interface COLLECTION KEY_GENERIC_TYPE extends Collection, ITE */ default JAVA_STREAM primitiveStream() { return StreamSupport.NEW_STREAM(SPLIT_ITERATORS.createJavaSplititerator(this, 0), false); } + /** + * Returns a Java-Type-Specific Parallel Stream to reduce boxing/unboxing. + * @return a Stream of the closest java type + */ + default JAVA_STREAM parallelPrimitiveStream() { return StreamSupport.NEW_STREAM(SPLIT_ITERATORS.createJavaSplititerator(this, 0), true); } #endif /** * A Type Specific Type Splititerator to reduce boxing/unboxing 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 7a9084c3..1024dc21 100644 --- a/src/builder/resources/speiger/assets/collections/templates/lists/ArrayList.template +++ b/src/builder/resources/speiger/assets/collections/templates/lists/ArrayList.template @@ -226,7 +226,6 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE * @param index the index where to append the elements to * @param c the elements to append to the list * @throws IndexOutOfBoundsException if index is outside of the lists range - * @deprecated if type is primitive */ @Override @Primitive @@ -248,7 +247,6 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE * @param index the index where to append the elements to * @param c the elements to append to the list * @throws IndexOutOfBoundsException if index is outside of the lists range - * @deprecated if type is primitive */ @Override public boolean addAll(int index, COLLECTION KEY_GENERIC_TYPE c) { @@ -268,7 +266,6 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE * @param index the index where to append the elements to * @param c the elements to append to the list * @throws IndexOutOfBoundsException if index is outside of the lists range - * @deprecated if type is primitive */ @Override public boolean addAll(int index, LIST KEY_GENERIC_TYPE c) { @@ -289,7 +286,6 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE * @param offset where to start ino the array * @param length the amount of elements to insert * @throws IndexOutOfBoundsException if index is outside of the lists range - * @deprecated if type is primitive */ @Override public void addElements(int from, KEY_TYPE[] a, int offset, int length) {