diff --git a/src/main/resources/speiger/assets/collections/templates/collections/AbstractCollection.template b/src/main/resources/speiger/assets/collections/templates/collections/AbstractCollection.template index 1627403..e718343 100644 --- a/src/main/resources/speiger/assets/collections/templates/collections/AbstractCollection.template +++ b/src/main/resources/speiger/assets/collections/templates/collections/AbstractCollection.template @@ -16,8 +16,8 @@ public abstract class ABSTRACT_COLLECTION KEY_GENERIC_TYPE extends AbstractColle #if !TYPE_OBJECT /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated @@ -35,8 +35,8 @@ public abstract class ABSTRACT_COLLECTION KEY_GENERIC_TYPE extends AbstractColle #if !TYPE_OBJECT /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated @@ -55,8 +55,8 @@ public abstract class ABSTRACT_COLLECTION KEY_GENERIC_TYPE extends AbstractColle #endif /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated @@ -66,8 +66,8 @@ public abstract class ABSTRACT_COLLECTION KEY_GENERIC_TYPE extends AbstractColle } /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated @@ -77,8 +77,8 @@ public abstract class ABSTRACT_COLLECTION KEY_GENERIC_TYPE extends AbstractColle } /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Primitive @@ -88,8 +88,8 @@ public abstract class ABSTRACT_COLLECTION KEY_GENERIC_TYPE extends AbstractColle } /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Primitive @@ -147,8 +147,8 @@ public abstract class ABSTRACT_COLLECTION KEY_GENERIC_TYPE extends AbstractColle #if !TYPE_OBJECT /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated diff --git a/src/main/resources/speiger/assets/collections/templates/collections/BidirectionalIterator.template b/src/main/resources/speiger/assets/collections/templates/collections/BidirectionalIterator.template index 4bfeddf..829b03f 100644 --- a/src/main/resources/speiger/assets/collections/templates/collections/BidirectionalIterator.template +++ b/src/main/resources/speiger/assets/collections/templates/collections/BidirectionalIterator.template @@ -29,8 +29,8 @@ public interface BI_ITERATOR KEY_GENERIC_TYPE extends ITERATOR KEY_GENERIC_TYPE #if !TYPE_OBJECT /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated diff --git a/src/main/resources/speiger/assets/collections/templates/collections/Collection.template b/src/main/resources/speiger/assets/collections/templates/collections/Collection.template index 9493cc5..505c41e 100644 --- a/src/main/resources/speiger/assets/collections/templates/collections/Collection.template +++ b/src/main/resources/speiger/assets/collections/templates/collections/Collection.template @@ -57,7 +57,7 @@ public interface COLLECTION KEY_GENERIC_TYPE extends Collection, ITE /** * Returns true if any element of the Collection is found in the provided collection. - * A Small Optimization method to find out of any element is present when comparing collections and not all of them. + * A Small Optimization function to find out of any element is present when comparing collections and not all of them. * @return true if any element was found. */ @Primitive @@ -104,8 +104,8 @@ public interface COLLECTION KEY_GENERIC_TYPE extends Collection, ITE #if PRIMITIVES /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated @@ -140,24 +140,24 @@ public interface COLLECTION KEY_GENERIC_TYPE extends Collection, ITE #endif /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated public default boolean add(CLASS_TYPE o) { return add(OBJ_TO_KEY(o)); } /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated public default boolean contains(Object o) { return o != null && contains(CLASS_TO_KEY(o)); } /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated diff --git a/src/main/resources/speiger/assets/collections/templates/collections/Iterable.template b/src/main/resources/speiger/assets/collections/templates/collections/Iterable.template index 973f273..25af233 100644 --- a/src/main/resources/speiger/assets/collections/templates/collections/Iterable.template +++ b/src/main/resources/speiger/assets/collections/templates/collections/Iterable.template @@ -22,7 +22,7 @@ public interface ITERABLE KEY_GENERIC_TYPE extends Iterable #if !TYPE_OBJECT /** - * A Type Specific foreach method that reduces (un)boxing + * A Type Specific foreach function that reduces (un)boxing * * @implSpec *

The default implementation behaves as if: @@ -40,8 +40,8 @@ public interface ITERABLE KEY_GENERIC_TYPE extends Iterable } /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Deprecated @Override diff --git a/src/main/resources/speiger/assets/collections/templates/collections/Iterator.template b/src/main/resources/speiger/assets/collections/templates/collections/Iterator.template index c5e0f07..20bf394 100644 --- a/src/main/resources/speiger/assets/collections/templates/collections/Iterator.template +++ b/src/main/resources/speiger/assets/collections/templates/collections/Iterator.template @@ -25,8 +25,8 @@ public interface ITERATOR KEY_GENERIC_TYPE extends Iterator public KEY_TYPE NEXT(); /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated @@ -54,8 +54,8 @@ public interface ITERATOR KEY_GENERIC_TYPE extends Iterator } /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Deprecated @Override diff --git a/src/main/resources/speiger/assets/collections/templates/collections/Stack.template b/src/main/resources/speiger/assets/collections/templates/collections/Stack.template index 4601682..fc64cc4 100644 --- a/src/main/resources/speiger/assets/collections/templates/collections/Stack.template +++ b/src/main/resources/speiger/assets/collections/templates/collections/Stack.template @@ -44,24 +44,24 @@ public interface STACK extends Stack #if !OBJECT_TYPE /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated public default void push(CLASS_TYPE e) { PUSH(OBJ_TO_KEY(e)); } /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated public default CLASS_TYPE pop() { return KEY_TO_OBJ(POP()); } /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated @@ -70,8 +70,8 @@ public interface STACK extends Stack } /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated diff --git a/src/main/resources/speiger/assets/collections/templates/functions/Comparator.template b/src/main/resources/speiger/assets/collections/templates/functions/Comparator.template index c894c4e..e5f9033 100644 --- a/src/main/resources/speiger/assets/collections/templates/functions/Comparator.template +++ b/src/main/resources/speiger/assets/collections/templates/functions/Comparator.template @@ -1,6 +1,7 @@ package speiger.src.collections.PACKAGE.functions; import java.util.Comparator; +import java.util.Objects; /** * Type-Specific Class for Comparator to reduce (un)boxing @@ -14,12 +15,23 @@ public interface COMPARATOR extends Comparator int compare(KEY_TYPE o1, KEY_TYPE o2); /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated default int compare(CLASS_TYPE o1, CLASS_TYPE o2) { return compare(OBJ_TO_KEY(o1), OBJ_TO_KEY(o2)); } + + /** + * A Wrapper function to convert a Non-Type-Specific Comparator to a Type-Specific-Comparator + * @param c comparator to convert + * @return the wrapper of the comparator + * @throws NullPointerException if the comparator is null + */ + public static COMPARATOR of(Comparator c) { + Objects.requireNonNull(c); + return (K, V) -> c.compare(KEY_TO_OBJ(K), KEY_TO_OBJ(V)) + } } \ No newline at end of file diff --git a/src/main/resources/speiger/assets/collections/templates/functions/Consumer.template b/src/main/resources/speiger/assets/collections/templates/functions/Consumer.template index 926f259..399ba36 100644 --- a/src/main/resources/speiger/assets/collections/templates/functions/Consumer.template +++ b/src/main/resources/speiger/assets/collections/templates/functions/Consumer.template @@ -21,7 +21,7 @@ public interface CONSUMER extends Consumer #endif { /** - * Type-Specific method to reduce (un)boxing. + * Type-Specific function to reduce (un)boxing. * Performs this operation on the given argument. * * @param t the input argument @@ -30,8 +30,8 @@ public interface CONSUMER extends Consumer #if !JDK_CONSUMER /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated @@ -44,16 +44,16 @@ public interface CONSUMER extends Consumer } /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated default void accept(CLASS_TYPE t) { accept(OBJ_TO_KEY(t)); } /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated @@ -64,8 +64,8 @@ public interface CONSUMER extends Consumer #if PRIMITIVES /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated diff --git a/src/main/resources/speiger/assets/collections/templates/lists/AbstractList.template b/src/main/resources/speiger/assets/collections/templates/lists/AbstractList.template index 930324b..5651c3b 100644 --- a/src/main/resources/speiger/assets/collections/templates/lists/AbstractList.template +++ b/src/main/resources/speiger/assets/collections/templates/lists/AbstractList.template @@ -9,29 +9,50 @@ import speiger.src.collections.PACKAGE.collections.ABSTRACT_COLLECTION; import speiger.src.collections.PACKAGE.collections.COLLECTION; import speiger.src.collections.PACKAGE.collections.ITERATOR; +/** + * Abstract implementation of the {@link LIST} interface. + */ public abstract class ABSTRACT_LIST KEY_GENERIC_TYPE extends ABSTRACT_COLLECTION KEY_GENERIC_TYPE implements LIST KEY_GENERIC_TYPE { #if !TYPE_OBJECT + /** + * A Type-Specific implementation of add function that delegates to {@link #add(int, KEY_TYPE)} + */ @Override public boolean add(KEY_TYPE e) { add(size(), e); return true; } + /** {@inheritDoc} + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. + */ @Override + @Deprecated public void add(int index, CLASS_TYPE element) { add(index, OBJ_TO_KEY(element)); } +#endif + /** + * A Type-Specific implementation that iterates over the elements and adds them. + * @param c the elements that wants to be added + * @return true if the list was modified + */ @Override - public boolean addAll(COLLECTION c) { + public boolean addAll(COLLECTION KEY_GENERIC_TYPE c) { boolean modified = false; for(KEY_TYPE e : c) modified |= add(e); return modified; } -#endif + /** + * A Type-Specific implementation that iterates over the elements and adds them. + * @param c the elements that wants to be added + * @return true if the list was modified + */ @Override public boolean addAll(LIST KEY_GENERIC_TYPE c) { boolean modified = false; @@ -40,7 +61,14 @@ public abstract class ABSTRACT_LIST KEY_GENERIC_TYPE extends ABSTRACT_COLLECTION return modified; } + /** + * The IndexOf implementation iterates over all elements and compares them to the search value. + * @param e the value that the index is searched for. + * @return index of the value that was searched for. -1 if not found + * @deprecated it is highly suggested not to use this with Primitives because of boxing. But it is still supported because of ObjectComparason that are custom objects and allow to find the contents. + */ @Override + @Primitive public int indexOf(Object o) { LIST_ITERATOR KEY_GENERIC_TYPE iter = listIterator(); #if TYPE_OBJECT @@ -61,7 +89,14 @@ public abstract class ABSTRACT_LIST KEY_GENERIC_TYPE extends ABSTRACT_COLLECTION return -1; } + /** + * The lastIndexOf implementation iterates over all elements and compares them to the search value. + * @param e the value that the index is searched for. + * @return the last index of the value that was searched for. -1 if not found + * @deprecated it is highly suggested not to use this with Primitives because of boxing. But it is still supported because of ObjectComparason that are custom objects and allow to find the contents. + */ @Override + @Primitive public int lastIndexOf(Object o) { LIST_ITERATOR KEY_GENERIC_TYPE iter = listIterator(size()); #if TYPE_OBJECT @@ -83,6 +118,11 @@ public abstract class ABSTRACT_LIST KEY_GENERIC_TYPE extends ABSTRACT_COLLECTION } #if !TYPE_OBJECT + /** + * The indexOf implementation iterates over all elements and compares them to the search value. + * @param e the value that the index is searched for. + * @return index of the value that was searched for. -1 if not found + */ @Override public int indexOf(KEY_TYPE e) { LIST_ITERATOR KEY_GENERIC_TYPE iter = listIterator(); @@ -93,6 +133,11 @@ public abstract class ABSTRACT_LIST KEY_GENERIC_TYPE extends ABSTRACT_COLLECTION return -1; } + /** + * The lastIndexOf implementation iterates over all elements and compares them to the search value. + * @param e the value that the index is searched for. + * @return the last index of the value that was searched for. -1 if not found + */ @Override public int lastIndexOf(KEY_TYPE e) { LIST_ITERATOR KEY_GENERIC_TYPE iter = listIterator(size()); @@ -104,6 +149,9 @@ public abstract class ABSTRACT_LIST KEY_GENERIC_TYPE extends ABSTRACT_COLLECTION } #endif + /** + * Compares if the list are the same. + */ @Override public boolean equals(Object o) { if (o == this) @@ -133,6 +181,9 @@ public abstract class ABSTRACT_LIST KEY_GENERIC_TYPE extends ABSTRACT_COLLECTION return !(e1.hasNext() || e2.hasNext()); } + /** + * Generates the hashcode based on the values stored in the list. + */ @Override public int hashCode() { int hashCode = 1; diff --git a/src/main/resources/speiger/assets/collections/templates/lists/ArrayList.template b/src/main/resources/speiger/assets/collections/templates/lists/ArrayList.template index eeba8d8..a7df193 100644 --- a/src/main/resources/speiger/assets/collections/templates/lists/ArrayList.template +++ b/src/main/resources/speiger/assets/collections/templates/lists/ArrayList.template @@ -37,16 +37,33 @@ import speiger.src.collections.PACKAGE.utils.IARRAY; import speiger.src.collections.utils.SanityChecks; #if TYPE_OBJECT +/** + * A Type-Specific Array-based implementation of list that is written to reduce (un)boxing + * + *

This implementation is optimized to improve how data is processed with interfaces like {@link IARRAY}, {@link Stack} + * and with optimized functions that use type-specific implementations for primitives and optimized logic for bulkactions. + */ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE implements IARRAY, Stack #else +/** + * A Type-Specific Array-based implementation of list that is written to reduce (un)boxing + * + *

This implementation is optimized to improve how data is processed with interfaces like {@link IARRAY}, {@link STACK} + * and with optimized functions that use type-specific implementations for primitives and optimized logic for bulkactions. + */ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE implements IARRAY, STACK #endif { static final int DEFAULT_ARRAY_SIZE = 10; + /** The backing array */ protected transient KEY_TYPE[] data; + /** The current size of the elements stored in the backing array */ protected int size = 0; + /** + * Creates a new ArrayList with a Empty array. + */ public ARRAY_LIST() { #if TYPE_OBJECT data = (KEY_TYPE[])ARRAYS.EMPTY_ARRAY; @@ -55,6 +72,9 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE #endif } + /** + * Creates a new ArrayList with the specific requested size + */ public ARRAY_LIST(int size) { #if TYPE_OBJECT data = (KEY_TYPE[])new Object[size]; @@ -63,30 +83,48 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE #endif } + /** + * Creates a new ArrayList a copy with the contents of the Collection. + */ public ARRAY_LIST(Collection c) { this(c.size()); size = ITERATORS.unwrap(data, c.iterator()); } + /** + * Creates a new ArrayList a copy with the contents of the Collection. + */ public ARRAY_LIST(COLLECTION KEY_GENERIC_TYPE c) { this(c.size()); size = ITERATORS.unwrap(data, c.iterator()); } + /** + * Creates a new ArrayList a copy with the contents of the List. + */ public ARRAY_LIST(LIST KEY_GENERIC_TYPE l) { this(l.size()); size = l.size(); l.getElements(0, data, 0, size); } + /** + * Creates a new ArrayList with a Copy of the array + */ public ARRAY_LIST(KEY_TYPE[] a) { this(a, 0, a.length); } + /** + * Creates a new ArrayList with a Copy of the array with a custom length + */ public ARRAY_LIST(KEY_TYPE[] a, int length) { this(a, 0, length); } + /** + * Creates a new ArrayList with a Copy of the array with in the custom range. + */ public ARRAY_LIST(KEY_TYPE[] a, int offset, int length) { this(length); SanityChecks.checkArrayCapacity(a.length, offset, length); @@ -94,10 +132,16 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE size = length; } + /** + * Creates a wrapped arraylist that uses the array as backing array + */ public static GENERIC_BRACES ARRAY_LIST KEY_GENERIC_TYPE wrap(KEY_TYPE[] a) { return wrap(a, a.length); } + /** + * Creates a wrapped arraylist that uses the array as backing array and a custom fillsize + */ public static GENERIC_BRACES ARRAY_LIST KEY_GENERIC_TYPE wrap(KEY_TYPE[] a, int length) { SanityChecks.checkArrayCapacity(a.length, 0, length); ARRAY_LIST KEY_GENERIC_TYPE list = new ARRAY_LISTBRACES(); @@ -107,6 +151,9 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE } #if TYPE_OBJECT + /** + * Creates a new ArrayList with a EmptyObject array of the Type requested + */ public static GENERIC_BRACES ARRAY_LIST KEY_GENERIC_TYPE of(Class c) { ARRAY_LIST KEY_GENERIC_TYPE list = new ARRAY_LISTBRACES(); list.data = (KEY_TYPE[])ObjectArrays.newArray(c.getClass().getComponentType(), 0); @@ -114,15 +161,12 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE } #endif - @Override - public void add(int index, CLASS_TYPE element) { - checkAddRange(index); - grow(size + 1); - if(index != size) System.arraycopy(data, index, data, index+1, size - index); - data[index] = OBJ_TO_KEY(element); - size++; - } - + /** + * 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}) + */ @Override public boolean add(KEY_TYPE e) { grow(size + 1); @@ -130,12 +174,21 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE return true; } + /** + * Appends the specified element to the end of this Stack. + * @param e element to be appended to this Stack + */ @Override public void PUSH(KEY_TYPE e) { add(e); } -#if !TYPE_OBJECT + /** + * Appends the specified element to the index of the list + * @param index the index where to append the element to + * @param e the element to append to the list + * @throws IndexOutOfBoundsException if index is outside of the lists range + */ @Override public void add(int index, KEY_TYPE e) { checkAddRange(index); @@ -145,7 +198,14 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE size++; } -#endif + /** + * Appends the specified elements to the index of the list. + * This function may delegate to more appropiate function if nessesary + * @param index the index where to append the elements to + * @param e the elements to append to the list + * @throws IndexOutOfBoundsException if index is outside of the lists range + * @deprecated if type is primitive + */ @Override @Primitive public boolean addAll(int index, Collection c) { @@ -160,6 +220,14 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE return true; } + /** + * Appends the specified elements to the index of the list. + * This function may delegate to more appropiate function if nessesary + * @param index the index where to append the elements to + * @param e 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) { if(c instanceof LIST) return addAll(index, (LIST KEY_GENERIC_TYPE)c); @@ -173,6 +241,13 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE return true; } + /** + * Appends the specified elements to the index of the list. + * @param index the index where to append the elements to + * @param e 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) { int add = c.size(); @@ -185,6 +260,15 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE return true; } + /** + * Appends the specified array elements to the index of the list. + * @param from the index where to append the elements to + * @param a the elements to append to the list + * @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) { if(length <= 0) return; @@ -195,6 +279,17 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE System.arraycopy(a, offset, data, from, length); } + /** + * A function to fast fetch elements from the list + * @param from index where the list should be fetching elements from + * @param a the array where the values should be inserted to + * @param offset the startIndex of where the array should be written to + * @param length the number of elements the values should be fetched from + * @returns the inputArray + * @throws NullPointerException if the array is null + * @throws IndexOutOfBoundsException if from is outside of the lists range + * @throws IllegalStateException if offset or length are smaller then 0 or exceed the array length + */ @Override public KEY_TYPE[] getElements(int from, KEY_TYPE[] a, int offset, int length) { SanityChecks.checkArrayCapacity(size, offset, length); @@ -202,6 +297,11 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE return a; } + /** + * a function to fast remove elements from the list. + * @param from the start index of where the elements should be removed from (inclusive) + * @param to the end index of where the elements should be removed to (exclusive) + */ @Override public void removeElements(int from, int to) { checkRange(from); @@ -217,6 +317,13 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE } #if TYPE_OBJECT + /** + * A function to fast extract elements out of the list, this removes the elements that were fetched. + * @param from the start index of where the elements should be fetched from (inclusive) + * @param to the end index of where the elements should be fetched to (exclusive) + * @param type the type of the OutputArray + * @return a array of the elements that were fetched + */ @Override public K[] extractElements(int from, int to, Class type) { checkRange(from); @@ -233,6 +340,12 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE } #else + /** + * A function to fast extract elements out of the list, this removes the elements that were fetched. + * @param from the start index of where the elements should be fetched from (inclusive) + * @param to the end index of where the elements should be fetched to (exclusive) + * @return a array of the elements that were fetched + */ @Override public KEY_TYPE[] extractElements(int from, int to) { int length = to - from; @@ -245,6 +358,14 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE } #endif + /** + * A function to check if all elements requested are present in the other collection. + * This function might delegate to a more appropiate function if nessesary + * @param c the collection that should be checked + * @return true if the collection contains all elements in this list + * @throws NullPointerException if the collection is null + * @deprecated if the collection is type-specific + */ @Override @Primitive public boolean containsAll(Collection c) { @@ -260,6 +381,14 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE return true; } + /** + * A function to check if any element of this list is present in the collection. + * This function might delegate to a more appropiate function if nessesary + * @param c the collection that should be checked + * @return true if the collection contains any elements in this list + * @throws NullPointerException if the collection is null + * @deprecated if the collection is type-specific + */ @Override @Primitive public boolean containsAny(Collection c) @@ -274,22 +403,50 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE #endif } return false; - } + } + /** + * A function to find the index of a given element + * @param e the element that is searched for + * @return the index of the element if found. (if not found then -1) + * @deprecated if type-specific but still supported because of special edgecase Object-Comparason features + */ @Override @Primitive public int indexOf(Object o) { +#if TYPE_OBJECT + if(o == null) { + for(int i = 0;i=0;i--) + if(data[i] == null) return i; + return -1; + } +#else if(o == null) return -1; +#endif for(int i = size - 1;i>=0;i--) { if(EQUALS_KEY_TYPE(data[i], o)) return i; } @@ -297,12 +454,22 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE } #if TYPE_OBJECT + /** + * Sorts the elements specified by the Natural order either by using the Comparator or the elements + * @see List#sort(Comparator) + * @see ARRAYS#stableSort(KEY_TYPE[], Comparator) + */ @Override public void sort(Comparator c) { if(c != null) ARRAYS.stableSort(data, size, c); else ARRAYS.stableSort((Comparable[])data, size); } + /** + * Sorts the elements specified by the Natural order either by using the Comparator or the elements using a unstable sort + * @see List#sort(Comparator) + * @see ARRAYS#unstableSort(KEY_TYPE[], Comparator) + */ @Override public void unstableSort(Comparator c) { if(c != null) ARRAYS.unstableSort(data, size, c); @@ -310,6 +477,12 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE } #endif + /** + * A Type-Specific implementation of containsAll. This implementation iterates over all elements and checks all elements are present in the other collection. + * @param the collection that should be checked if it contains all elements. + * @return true if all elements were found in the collection + * @throws NullPointerException if the collection is null + */ @Override public boolean containsAll(COLLECTION KEY_GENERIC_TYPE c) { Objects.requireNonNull(c); @@ -317,8 +490,14 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE if(!c.contains(data[i])) return false; } return true; - } + } + /** + * This implementation iterates over the elements of the collection and checks if they are stored in this collection. + * @param c the elements that should be checked for + * @return true if any element is in this collection + * @throws NullPointerException if the collection is null + */ @Override public boolean containsAny(COLLECTION KEY_GENERIC_TYPE c) { Objects.requireNonNull(c); @@ -329,6 +508,11 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE } #if !TYPE_OBJECT + /** + * A Type-Specific function to find the index of a given element + * @param e the element that is searched for + * @return the index of the element if found. (if not found then -1) + */ @Override public int indexOf(KEY_TYPE e) { for(int i = 0;i=0;i--) { @@ -345,12 +534,22 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE return -1; } + /** + * Sorts the elements specified by the Natural order either by using the Comparator or the elements + * @see List#sort(Comparator) + * @see ARRAYS#stableSort(KEY_TYPE[], Comparator) + */ @Override public void sort(COMPARATOR c) { if(c != null) ARRAYS.stableSort(data, size, c); else ARRAYS.stableSort(data, size); } + /** + * Sorts the elements specified by the Natural order either by using the Comparator or the elements using a unstable sort + * @see List#sort(Comparator) + * @see ARRAYS#unstableSort(KEY_TYPE[], Comparator) + */ @Override public void unstableSort(COMPARATOR c) { if(c != null) ARRAYS.unstableSort(data, size, c); @@ -358,31 +557,70 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE } #endif + /** + * A Type-Specific get function to reduce (un)boxing + * @param index the index of the element to fetch + * @return the value of the requested index + * @throws IndexOutOfBoundsException if the index is out of range + */ @Override public KEY_TYPE GET_KEY(int index) { checkRange(index); return data[index]; } + /** + * Provides the Selected Object from the stack. + * Top to bottom + * @param index of the element that should be provided + * @return the element that was requested + * @throws ArrayIndexOutOfBoundsException if the index is out of bounds + * @see Stack#peek(int) + */ @Override public KEY_TYPE PEEK(int index) { checkRange((size() - 1) - index); return data[(size() - 1) - index]; } + /** + * Provides the Underlying Array in the Implementation + * @return underlying Array + * @throws ClassCastException if the return type does not match the underlying array. (Only for Object Implementations) + */ @Override public KEY_TYPE[] elements() { return data; } + /** + * A Type Specific foreach function that reduces (un)boxing + * + * @implSpec + *

The default implementation behaves as if: + *

{@code
+     *     for(int i = 0;i
+     *
+     * @param action The action to be performed for each element
+     * @throws NullPointerException if the specified action is null
+     * @see Iterable#forEach(Consumer)
+     */
 	@Override
-	@Primitive
 	public void forEach(CONSUMER KEY_SUPER_GENERIC_TYPE action) {
 		Objects.requireNonNull(action);
 		for(int i = 0;i o) {
-		for(int i = 0;i KEY_TO_OBJ(o.APPLY(OBJ_TO_KEY(T))));
+#else
+	for(int i = 0;i c) {
 		if(c.isEmpty()) return false;
 		if(c instanceof COLLECTION) return removeAll((COLLECTION KEY_GENERIC_TYPE)c);
 		boolean modified = false;
-		for(int i = 0, j = 0;i c) {
@@ -451,42 +737,74 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE
 		}
 		if(c instanceof COLLECTION) return retainAll((COLLECTION KEY_GENERIC_TYPE)c);
 		boolean modified = false;
-		for(int i = 0, j = 0;i filter) {
+		
 		Objects.requireNonNull(filter);
 		boolean modified = false;
-		for(int i = 0, j = 0;i E[] toArray(E[] a) {
@@ -547,11 +883,21 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE
 	}
 	
 #endif
+	/**
+	 * A function to return the size of the list
+	 * @return the size of elements in the list
+	 */
 	@Override
 	public int size() {
 		return size;
 	}
 	
+	/**
+	 * A function to ensure the elements are within the requested size.
+	 * If smaller then the stored elements they get removed as needed.
+	 * If bigger it is ensured that enough room is provided depending on the implementation
+	 * @param size the requested amount of elements/room for elements
+	 */
 	@Override
 	public void size(int size) {
 		if(size > data.length)
@@ -560,6 +906,9 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE
 			Arrays.fill(data, size, size(), EMPTY_VALUE);
 	}
 	
+	/**
+	 * A function to clear all elements in the list.
+	 */
 	@Override
 	public void clear() {
 #if TYPE_OBJECT
@@ -568,6 +917,10 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE
 		size = 0;
 	}
 	
+	/**
+	 * Trims the original collection down to the size of the current elements or the requested size depending which is bigger
+	 * @param size the requested trim size.
+	 */
 	@Override
 	public void trim(int size) {
 		if(size > size() || size() == data.length) return;
@@ -579,6 +932,13 @@ public class ARRAY_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE
 #endif
 	}
 	
+	/**
+	 * Increases the capacity of this implementation instance, if necessary,
+	 * to ensure that it can hold at least the number of elements specified by
+	 * the minimum capacity argument.
+	 *
+	 * @param size the desired minimum capacity
+	 */
 	@Override
 	public void ensureCapacity(int size) {
 		grow(size);
diff --git a/src/main/resources/speiger/assets/collections/templates/lists/List.template b/src/main/resources/speiger/assets/collections/templates/lists/List.template
index a2a4724..42e254d 100644
--- a/src/main/resources/speiger/assets/collections/templates/lists/List.template
+++ b/src/main/resources/speiger/assets/collections/templates/lists/List.template
@@ -142,7 +142,7 @@ public interface LIST KEY_GENERIC_TYPE extends COLLECTION KEY_GENERIC_TYPE, List
 	
 #endif
 	/**
-	 * A method to fast add elements to the list
+	 * A function to fast add elements to the list
 	 * @param from the index where the elements should be added into the list
 	 * @param a the elements that should be added
 	 * @throws IndexOutOfBoundsException if from is outside of the lists range
@@ -150,7 +150,7 @@ public interface LIST KEY_GENERIC_TYPE extends COLLECTION KEY_GENERIC_TYPE, List
 	public default void addElements(int from, KEY_TYPE[] a) { addElements(from, a, 0, a.length); }
 	
 	/**
-	 * A method to fast add elements to the list
+	 * A function to fast add elements to the list
 	 * @param from the index where the elements should be added into the list
 	 * @param a the elements that should be added
 	 * @param offset the start index of the array should be read from
@@ -161,7 +161,7 @@ public interface LIST KEY_GENERIC_TYPE extends COLLECTION KEY_GENERIC_TYPE, List
 	public void addElements(int from, KEY_TYPE[] a, int offset, int length);
 	
 	/**
-	 * A method to fast fetch elements from the list
+	 * A function to fast fetch elements from the list
 	 * @param from index where the list should be fetching elements from
 	 * @param a the array where the values should be inserted to
 	 * @returns the inputArray
@@ -172,7 +172,7 @@ public interface LIST KEY_GENERIC_TYPE extends COLLECTION KEY_GENERIC_TYPE, List
 	public default KEY_TYPE[] getElements(int from, KEY_TYPE[] a) { return getElements(from, a, 0, a.length); }
 	
 	/**
-	 * A method to fast fetch elements from the list
+	 * A function to fast fetch elements from the list
 	 * @param from index where the list should be fetching elements from
 	 * @param a the array where the values should be inserted to
 	 * @param offset the startIndex of where the array should be written to
@@ -185,7 +185,7 @@ public interface LIST KEY_GENERIC_TYPE extends COLLECTION KEY_GENERIC_TYPE, List
 	public KEY_TYPE[] getElements(int from, KEY_TYPE[] a, int offset, int length);
 	
 	/**
-	 * a method to fast remove elements from the list.
+	 * a function to fast remove elements from the list.
 	 * @param from the start index of where the elements should be removed from (inclusive)
 	 * @param to the end index of where the elements should be removed to (exclusive)
 	 */
@@ -193,7 +193,7 @@ public interface LIST KEY_GENERIC_TYPE extends COLLECTION KEY_GENERIC_TYPE, List
 	
 #if TYPE_OBJECT
 	/**
-	 * A method to fast extract elements out of the list, this removes the elements that were fetched.
+	 * A function to fast extract elements out of the list, this removes the elements that were fetched.
 	 * @param from the start index of where the elements should be fetched from (inclusive)
 	 * @param to the end index of where the elements should be fetched to (exclusive)
 	 * @param type the type of the OutputArray
@@ -236,7 +236,7 @@ public interface LIST KEY_GENERIC_TYPE extends COLLECTION KEY_GENERIC_TYPE, List
 	
 #else
 	/**
-	 * A method to fast extract elements out of the list, this removes the elements that were fetched.
+	 * A function to fast extract elements out of the list, this removes the elements that were fetched.
 	 * @param from the start index of where the elements should be fetched from (inclusive)
 	 * @param to the end index of where the elements should be fetched to (exclusive)
 	 * @return a array of the elements that were fetched
@@ -244,8 +244,8 @@ public interface LIST KEY_GENERIC_TYPE extends COLLECTION KEY_GENERIC_TYPE, List
 	public KEY_TYPE[] extractElements(int from, int to);
 	
 	/** {@inheritDoc}
-	 * 

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated @@ -270,8 +270,8 @@ public interface LIST KEY_GENERIC_TYPE extends COLLECTION KEY_GENERIC_TYPE, List } /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Deprecated public default void unstableSort(Comparator c) { @@ -317,7 +317,7 @@ public interface LIST KEY_GENERIC_TYPE extends COLLECTION KEY_GENERIC_TYPE, List public LIST KEY_GENERIC_TYPE subList(int from, int to); /** - * A Method to ensure the elements are within the requested size. + * A function to ensure the elements are within the requested size. * If smaller then the stored elements they get removed as needed. * If bigger it is ensured that enough room is provided depending on the implementation * @param size the requested amount of elements/room for elements @@ -327,8 +327,8 @@ public interface LIST KEY_GENERIC_TYPE extends COLLECTION KEY_GENERIC_TYPE, List #if !TYPE_OBJECT /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated @@ -337,8 +337,8 @@ public interface LIST KEY_GENERIC_TYPE extends COLLECTION KEY_GENERIC_TYPE, List } /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated @@ -347,8 +347,8 @@ public interface LIST KEY_GENERIC_TYPE extends COLLECTION KEY_GENERIC_TYPE, List } /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated @@ -357,8 +357,8 @@ public interface LIST KEY_GENERIC_TYPE extends COLLECTION KEY_GENERIC_TYPE, List } /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated @@ -367,8 +367,8 @@ public interface LIST KEY_GENERIC_TYPE extends COLLECTION KEY_GENERIC_TYPE, List } /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated @@ -377,8 +377,8 @@ public interface LIST KEY_GENERIC_TYPE extends COLLECTION KEY_GENERIC_TYPE, List } /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated @@ -387,8 +387,8 @@ public interface LIST KEY_GENERIC_TYPE extends COLLECTION KEY_GENERIC_TYPE, List } /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated @@ -397,8 +397,8 @@ public interface LIST KEY_GENERIC_TYPE extends COLLECTION KEY_GENERIC_TYPE, List } /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated @@ -408,8 +408,8 @@ public interface LIST KEY_GENERIC_TYPE extends COLLECTION KEY_GENERIC_TYPE, List #if !TYPE_BOOLEAN /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated diff --git a/src/main/resources/speiger/assets/collections/templates/lists/ListIterator.template b/src/main/resources/speiger/assets/collections/templates/lists/ListIterator.template index 70e5560..95bd36c 100644 --- a/src/main/resources/speiger/assets/collections/templates/lists/ListIterator.template +++ b/src/main/resources/speiger/assets/collections/templates/lists/ListIterator.template @@ -20,8 +20,8 @@ public interface LIST_ITERATOR KEY_GENERIC_TYPE extends ListIterator public void add(KEY_TYPE e); /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated @@ -30,8 +30,8 @@ public interface LIST_ITERATOR KEY_GENERIC_TYPE extends ListIterator } /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated @@ -40,8 +40,8 @@ public interface LIST_ITERATOR KEY_GENERIC_TYPE extends ListIterator } /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated @@ -50,8 +50,8 @@ public interface LIST_ITERATOR KEY_GENERIC_TYPE extends ListIterator } /** {@inheritDoc} - *

This default implementation delegates to the corresponding type-specific method. - * @deprecated Please use the corresponding type-specific method instead. + *

This default implementation delegates to the corresponding type-specific function. + * @deprecated Please use the corresponding type-specific function instead. */ @Override @Deprecated diff --git a/src/main/resources/speiger/assets/collections/templates/utils/IArray.template b/src/main/resources/speiger/assets/collections/templates/utils/IArray.template index 2ced7f9..d0a9009 100644 --- a/src/main/resources/speiger/assets/collections/templates/utils/IArray.template +++ b/src/main/resources/speiger/assets/collections/templates/utils/IArray.template @@ -19,7 +19,7 @@ public interface IARRAY KEY_GENERIC_TYPE extends IArray public KEY_TYPE[] elements(); /** - * Provides the Underlying Array in the Implementation. This method exists purely because of Synchronization wrappers to help run Synchronized Code + * Provides the Underlying Array in the Implementation. This function exists purely because of Synchronization wrappers to help run Synchronized Code * @param action the action that handles the array * @throws NullPointerException if action is null * @throws ClassCastException if the return type does not match the underlying array. (Only for Object Implementations)