2020-11-16 02:55:33 +01:00
|
|
|
package speiger.src.collections.PACKAGE.lists;
|
|
|
|
|
|
|
|
import java.util.List;
|
2020-11-30 00:11:40 +01:00
|
|
|
#if !TYPE_OBJECT && !TYPE_BOOLEAN
|
|
|
|
import java.util.Objects;
|
2021-01-24 07:39:13 +01:00
|
|
|
import java.util.function.JAVA_UNARY_OPERATOR;
|
2020-11-30 00:11:40 +01:00
|
|
|
import java.util.function.UnaryOperator;
|
2020-12-06 09:32:22 +01:00
|
|
|
#else if TYPE_OBJECT
|
|
|
|
import java.util.Objects;
|
|
|
|
import java.util.function.UnaryOperator;
|
2020-11-30 00:11:40 +01:00
|
|
|
#endif
|
2020-12-01 02:43:13 +01:00
|
|
|
import java.util.Comparator;
|
2020-11-30 00:11:40 +01:00
|
|
|
|
2020-11-16 02:55:33 +01:00
|
|
|
import speiger.src.collections.PACKAGE.collections.COLLECTION;
|
2020-12-01 02:43:13 +01:00
|
|
|
#if !TYPE_OBJECT
|
|
|
|
import speiger.src.collections.PACKAGE.functions.COMPARATOR;
|
|
|
|
#endif
|
|
|
|
import speiger.src.collections.PACKAGE.utils.ARRAYS;
|
|
|
|
#if TYPE_BYTE || TYPE_SHORT || TYPE_CHAR || TYPE_FLOAT
|
|
|
|
import speiger.src.collections.utils.SanityChecks;
|
|
|
|
#endif
|
2020-11-16 02:55:33 +01:00
|
|
|
|
|
|
|
public interface LIST KEY_GENERIC_TYPE extends COLLECTION KEY_GENERIC_TYPE, List<CLASS_TYPE>
|
|
|
|
{
|
|
|
|
#if !TYPE_OBJECT
|
2020-12-06 09:32:22 +01:00
|
|
|
/**
|
|
|
|
* A Type-Specific add Function to reduce (un)boxing
|
|
|
|
* @param e the element to add
|
|
|
|
* @return true if the list was modified
|
|
|
|
* @see List#add(Object)
|
|
|
|
*/
|
2020-11-30 00:11:40 +01:00
|
|
|
@Override
|
2020-11-16 02:55:33 +01:00
|
|
|
public boolean add(KEY_TYPE e);
|
|
|
|
|
2020-12-06 09:32:22 +01:00
|
|
|
/**
|
|
|
|
* A Type-Specific add Function to reduce (un)boxing
|
|
|
|
* @param e the element to add
|
|
|
|
* @param index index at which the specified element is to be inserted
|
|
|
|
* @see List#add(int, Object)
|
|
|
|
*/
|
2020-11-16 02:55:33 +01:00
|
|
|
public void add(int index, KEY_TYPE e);
|
2020-11-26 22:56:15 +01:00
|
|
|
|
2020-11-16 02:55:33 +01:00
|
|
|
#endif
|
2020-12-06 09:32:22 +01:00
|
|
|
/**
|
|
|
|
* A Type-Specific addAll Function to reduce (un)boxing
|
|
|
|
* @param c the elements that need to be added
|
|
|
|
* @param index index at which the specified elements is to be inserted
|
|
|
|
* @return true if the list was modified
|
2021-04-22 23:02:04 +02:00
|
|
|
* @see java.util.List#addAll(int, Collection)
|
2020-12-06 09:32:22 +01:00
|
|
|
*/
|
2020-11-26 22:56:15 +01:00
|
|
|
public boolean addAll(int index, COLLECTION KEY_GENERIC_TYPE c);
|
|
|
|
|
2020-12-06 09:32:22 +01:00
|
|
|
/**
|
|
|
|
* A Type-Specific and optimized addAll function that allows a faster transfer of elements
|
|
|
|
* @param c the elements that need to be added
|
|
|
|
* @return true if the list was modified
|
|
|
|
*/
|
2020-11-16 02:55:33 +01:00
|
|
|
public boolean addAll(LIST KEY_GENERIC_TYPE c);
|
|
|
|
|
2020-12-06 09:32:22 +01:00
|
|
|
/**
|
|
|
|
* A Type-Specific and optimized addAll function that allows a faster transfer of elements
|
|
|
|
* @param c the elements that need to be added
|
|
|
|
* @param index index at which the specified elements is to be inserted
|
|
|
|
* @return true if the list was modified
|
|
|
|
*/
|
2020-11-16 02:55:33 +01:00
|
|
|
public boolean addAll(int index, LIST KEY_GENERIC_TYPE c);
|
|
|
|
|
|
|
|
#if !TYPE_OBJECT
|
2020-12-06 09:32:22 +01:00
|
|
|
/**
|
|
|
|
* A Type-Specific get function to reduce (un)boxing
|
|
|
|
* @param index the index of the value that is requested
|
|
|
|
* @return the value at the given index
|
|
|
|
* @throws IndexOutOfBoundsException if the index is not within the list range
|
|
|
|
* @see List#get(int)
|
|
|
|
*/
|
2020-11-16 02:55:33 +01:00
|
|
|
public KEY_TYPE GET_KEY(int index);
|
|
|
|
|
2020-12-06 09:32:22 +01:00
|
|
|
/**
|
|
|
|
* A Type-Specific set function to reduce (un)boxing
|
|
|
|
* @param index index of the element to replace
|
2021-04-22 23:02:04 +02:00
|
|
|
* @param e element to be stored at the specified position
|
2020-12-06 09:32:22 +01:00
|
|
|
* @return the element previously at the specified position
|
|
|
|
* @throws IndexOutOfBoundsException if the index is not within the list range
|
|
|
|
* @see List#set(int, Object)
|
|
|
|
*/
|
2020-11-16 02:55:33 +01:00
|
|
|
public KEY_TYPE set(int index, KEY_TYPE e);
|
|
|
|
|
2020-12-06 09:32:22 +01:00
|
|
|
/**
|
|
|
|
* A Type-Specific remove function to reduce (un)boxing
|
|
|
|
* @param index the index of the element to be removed
|
|
|
|
* @return the element previously at the specified position
|
|
|
|
* @see List#remove(int)
|
|
|
|
*/
|
2020-11-16 02:55:33 +01:00
|
|
|
public KEY_TYPE REMOVE(int index);
|
|
|
|
|
2020-12-06 09:32:22 +01:00
|
|
|
/**
|
|
|
|
* A Type-Specific indexOf function to reduce (un)boxing
|
|
|
|
* @param e the element that is searched for
|
|
|
|
* @return the index of the element if found. (if not found then -1)
|
|
|
|
* @note does not support null values
|
|
|
|
*/
|
2020-11-16 02:55:33 +01:00
|
|
|
public int indexOf(KEY_TYPE e);
|
|
|
|
|
2020-12-06 09:32:22 +01:00
|
|
|
/**
|
|
|
|
* A Type-Specific lastIndexOf function to reduce (un)boxing
|
|
|
|
* @param e the element that is searched for
|
|
|
|
* @return the lastIndex of the element if found. (if not found then -1)
|
|
|
|
* @note does not support null values
|
|
|
|
*/
|
2020-11-16 02:55:33 +01:00
|
|
|
public int lastIndexOf(KEY_TYPE e);
|
2020-11-30 00:11:40 +01:00
|
|
|
|
|
|
|
#if !TYPE_BOOLEAN
|
2020-12-06 09:32:22 +01:00
|
|
|
/**
|
|
|
|
* A Type-Specific replace function to reduce (un)boxing
|
|
|
|
* @param o the action to replace the values
|
|
|
|
* @throws NullPointerException if o is null
|
|
|
|
*/
|
2021-01-24 07:39:13 +01:00
|
|
|
public default void REPLACE(JAVA_UNARY_OPERATOR o) {
|
2020-11-30 00:11:40 +01:00
|
|
|
Objects.requireNonNull(o);
|
|
|
|
LIST_ITERATOR iter = listIterator();
|
|
|
|
while (iter.hasNext())
|
|
|
|
#if TYPE_BYTE || TYPE_SHORT || TYPE_CHAR || TYPE_FLOAT
|
2021-01-24 07:39:13 +01:00
|
|
|
iter.set(SanityChecks.SANITY_CAST(o.APPLY_CAST(iter.NEXT())));
|
2020-11-30 00:11:40 +01:00
|
|
|
#else
|
|
|
|
iter.set(o.APPLY(iter.NEXT()));
|
2020-11-26 22:56:15 +01:00
|
|
|
#endif
|
2020-11-30 00:11:40 +01:00
|
|
|
}
|
2020-11-26 22:56:15 +01:00
|
|
|
|
2020-11-30 00:11:40 +01:00
|
|
|
#endif
|
2020-12-06 09:32:22 +01:00
|
|
|
#else
|
|
|
|
/**
|
|
|
|
* A function to replace all values in the list
|
|
|
|
* @param o the action to replace the values
|
|
|
|
* @throws NullPointerException if o is null
|
|
|
|
*/
|
|
|
|
@Override
|
|
|
|
public default void replaceAll(UnaryOperator<CLASS_TYPE> o) {
|
|
|
|
Objects.requireNonNull(o);
|
|
|
|
LIST_ITERATOR KEY_GENERIC_TYPE iter = listIterator();
|
|
|
|
while (iter.hasNext()) iter.set(o.apply(iter.NEXT()));
|
|
|
|
}
|
|
|
|
|
2020-11-30 00:11:40 +01:00
|
|
|
#endif
|
2021-04-22 23:02:04 +02:00
|
|
|
/**
|
|
|
|
* A function to fast add elements to the list
|
|
|
|
* @param a the elements that should be added
|
|
|
|
* @throws IndexOutOfBoundsException if from is outside of the lists range
|
|
|
|
*/
|
|
|
|
public default void addElements(KEY_TYPE... a) { addElements(0, a, 0, a.length); }
|
|
|
|
|
2020-12-06 09:32:22 +01:00
|
|
|
/**
|
2020-12-07 08:55:22 +01:00
|
|
|
* A function to fast add elements to the list
|
2020-12-06 09:32:22 +01:00
|
|
|
* @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
|
|
|
|
*/
|
2021-04-22 23:02:04 +02:00
|
|
|
public default void addElements(int from, KEY_TYPE... a) { addElements(from, a, 0, a.length); }
|
2020-11-26 22:56:15 +01:00
|
|
|
|
2020-12-06 09:32:22 +01:00
|
|
|
/**
|
2020-12-07 08:55:22 +01:00
|
|
|
* A function to fast add elements to the list
|
2020-12-06 09:32:22 +01:00
|
|
|
* @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
|
|
|
|
* @param length how many elements should be read from
|
|
|
|
* @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
|
|
|
|
*/
|
2020-11-26 22:56:15 +01:00
|
|
|
public void addElements(int from, KEY_TYPE[] a, int offset, int length);
|
|
|
|
|
2020-12-06 09:32:22 +01:00
|
|
|
/**
|
2020-12-07 08:55:22 +01:00
|
|
|
* A function to fast fetch elements from the list
|
2020-12-06 09:32:22 +01:00
|
|
|
* @param from index where the list should be fetching elements from
|
|
|
|
* @param a the array where the values should be inserted to
|
2021-04-22 23:02:04 +02:00
|
|
|
* @return the inputArray
|
2020-12-06 09:32:22 +01:00
|
|
|
* @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
|
|
|
|
*/
|
2020-11-26 22:56:15 +01:00
|
|
|
public default KEY_TYPE[] getElements(int from, KEY_TYPE[] a) { return getElements(from, a, 0, a.length); }
|
|
|
|
|
2020-12-06 09:32:22 +01:00
|
|
|
/**
|
2020-12-07 08:55:22 +01:00
|
|
|
* A function to fast fetch elements from the list
|
2020-12-06 09:32:22 +01:00
|
|
|
* @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
|
2021-04-22 23:02:04 +02:00
|
|
|
* @return the inputArray
|
2020-12-06 09:32:22 +01:00
|
|
|
* @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
|
|
|
|
*/
|
2020-11-26 22:56:15 +01:00
|
|
|
public KEY_TYPE[] getElements(int from, KEY_TYPE[] a, int offset, int length);
|
|
|
|
|
2020-12-06 09:32:22 +01:00
|
|
|
/**
|
2020-12-07 08:55:22 +01:00
|
|
|
* a function to fast remove elements from the list.
|
2020-12-06 09:32:22 +01:00
|
|
|
* @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)
|
|
|
|
*/
|
2020-11-26 22:56:15 +01:00
|
|
|
public void removeElements(int from, int to);
|
|
|
|
|
|
|
|
#if TYPE_OBJECT
|
2020-12-06 09:32:22 +01:00
|
|
|
/**
|
2020-12-07 08:55:22 +01:00
|
|
|
* A function to fast extract elements out of the list, this removes the elements that were fetched.
|
2020-12-06 09:32:22 +01:00
|
|
|
* @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
|
|
|
|
*/
|
|
|
|
public <K> K[] extractElements(int from, int to, Class<K> type);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 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)
|
|
|
|
*/
|
2020-12-01 02:43:13 +01:00
|
|
|
@Override
|
|
|
|
public default void sort(Comparator<? super CLASS_TYPE> c) {
|
|
|
|
KEY_TYPE[] array = (KEY_TYPE[])TO_ARRAY();
|
|
|
|
if(c != null) ARRAYS.stableSort(array, c);
|
|
|
|
else ARRAYS.stableSort((Comparable[])array);
|
|
|
|
LIST_ITERATOR KEY_GENERIC_TYPE iter = listIterator();
|
|
|
|
for (int i = 0,m=size();i<m && iter.hasNext();i++) {
|
|
|
|
iter.NEXT();
|
|
|
|
iter.set(array[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-06 09:32:22 +01:00
|
|
|
/**
|
|
|
|
* 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)
|
|
|
|
*/
|
2020-12-01 02:43:13 +01:00
|
|
|
public default void unstableSort(Comparator<? super CLASS_TYPE> c) {
|
|
|
|
KEY_TYPE[] array = (KEY_TYPE[])TO_ARRAY();
|
|
|
|
if(c != null) ARRAYS.unstableSort(array, c);
|
|
|
|
else ARRAYS.unstableSort((Comparable[])array);
|
|
|
|
LIST_ITERATOR KEY_GENERIC_TYPE iter = listIterator();
|
|
|
|
for (int i = 0,m=size();i<m && iter.hasNext();i++) {
|
|
|
|
iter.NEXT();
|
|
|
|
iter.set(array[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-26 22:56:15 +01:00
|
|
|
#else
|
2020-12-06 09:32:22 +01:00
|
|
|
/**
|
2020-12-07 08:55:22 +01:00
|
|
|
* A function to fast extract elements out of the list, this removes the elements that were fetched.
|
2020-12-06 09:32:22 +01:00
|
|
|
* @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
|
|
|
|
*/
|
2020-11-26 22:56:15 +01:00
|
|
|
public KEY_TYPE[] extractElements(int from, int to);
|
|
|
|
|
2020-12-06 09:32:22 +01:00
|
|
|
/** {@inheritDoc}
|
2020-12-07 08:55:22 +01:00
|
|
|
* <p>This default implementation delegates to the corresponding type-specific function.
|
|
|
|
* @deprecated Please use the corresponding type-specific function instead.
|
2020-12-06 09:32:22 +01:00
|
|
|
*/
|
2020-12-01 02:43:13 +01:00
|
|
|
@Override
|
2020-12-06 09:32:22 +01:00
|
|
|
@Deprecated
|
2020-12-01 02:43:13 +01:00
|
|
|
default void sort(Comparator<? super CLASS_TYPE> c) {
|
|
|
|
sort((K, V) -> c.compare(KEY_TO_OBJ(K), KEY_TO_OBJ(V)));
|
|
|
|
}
|
2020-12-06 09:32:22 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Sorts the elements specified by the Natural order either by using the Comparator or the elements
|
2021-04-22 23:02:04 +02:00
|
|
|
* @param c the sorter of the elements, can be null
|
2020-12-06 09:32:22 +01:00
|
|
|
* @see List#sort(Comparator)
|
2021-04-22 23:02:04 +02:00
|
|
|
* @see ARRAYS#stableSort(KEY_TYPE[], COMPARATOR)
|
2020-12-06 09:32:22 +01:00
|
|
|
*/
|
2020-12-01 02:43:13 +01:00
|
|
|
public default void sort(COMPARATOR c) {
|
|
|
|
KEY_TYPE[] array = TO_ARRAY();
|
|
|
|
if(c != null) ARRAYS.stableSort(array, c);
|
|
|
|
else ARRAYS.stableSort(array);
|
|
|
|
LIST_ITERATOR KEY_GENERIC_TYPE iter = listIterator();
|
|
|
|
for (int i = 0,m=size();i<m && iter.hasNext();i++) {
|
|
|
|
iter.NEXT();
|
|
|
|
iter.set(array[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-12-06 09:32:22 +01:00
|
|
|
/** {@inheritDoc}
|
2020-12-07 08:55:22 +01:00
|
|
|
* <p>This default implementation delegates to the corresponding type-specific function.
|
|
|
|
* @deprecated Please use the corresponding type-specific function instead.
|
2020-12-06 09:32:22 +01:00
|
|
|
*/
|
|
|
|
@Deprecated
|
2020-12-01 02:43:13 +01:00
|
|
|
public default void unstableSort(Comparator<? super CLASS_TYPE> c) {
|
|
|
|
unstableSort((K, V) -> c.compare(KEY_TO_OBJ(K), KEY_TO_OBJ(V)));
|
|
|
|
}
|
|
|
|
|
2020-12-06 09:32:22 +01:00
|
|
|
/**
|
|
|
|
* Sorts the elements specified by the Natural order either by using the Comparator or the elements using a unstable sort
|
2021-04-22 23:02:04 +02:00
|
|
|
* @param c the sorter of the elements, can be null
|
2020-12-06 09:32:22 +01:00
|
|
|
* @see List#sort(Comparator)
|
2021-04-22 23:02:04 +02:00
|
|
|
* @see ARRAYS#unstableSort(KEY_TYPE[], COMPARATOR)
|
2020-12-06 09:32:22 +01:00
|
|
|
*/
|
2020-12-01 02:43:13 +01:00
|
|
|
public default void unstableSort(COMPARATOR c) {
|
|
|
|
KEY_TYPE[] array = TO_ARRAY();
|
|
|
|
if(c != null) ARRAYS.unstableSort(array, c);
|
|
|
|
else ARRAYS.unstableSort(array);
|
|
|
|
LIST_ITERATOR KEY_GENERIC_TYPE iter = listIterator();
|
|
|
|
for (int i = 0,m=size();i<m && iter.hasNext();i++) {
|
|
|
|
iter.NEXT();
|
|
|
|
iter.set(array[i]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-11-16 02:55:33 +01:00
|
|
|
#endif
|
2020-12-06 09:32:22 +01:00
|
|
|
/**
|
|
|
|
* A Type-Specific Iterator of listIterator
|
|
|
|
* @see List#listIterator
|
|
|
|
*/
|
2020-11-16 02:55:33 +01:00
|
|
|
@Override
|
|
|
|
public LIST_ITERATOR KEY_GENERIC_TYPE listIterator();
|
|
|
|
|
2020-12-06 09:32:22 +01:00
|
|
|
/**
|
|
|
|
* A Type-Specific Iterator of listIterator
|
|
|
|
* @see List#listIterator(int)
|
|
|
|
*/
|
2020-11-16 02:55:33 +01:00
|
|
|
@Override
|
|
|
|
public LIST_ITERATOR KEY_GENERIC_TYPE listIterator(int index);
|
|
|
|
|
2020-12-06 09:32:22 +01:00
|
|
|
/**
|
|
|
|
* A Type-Specific List of subList
|
|
|
|
* @see List#subList(int, int)
|
|
|
|
*/
|
2020-11-16 02:55:33 +01:00
|
|
|
@Override
|
|
|
|
public LIST KEY_GENERIC_TYPE subList(int from, int to);
|
|
|
|
|
2020-12-06 09:32:22 +01:00
|
|
|
/**
|
2020-12-07 08:55:22 +01:00
|
|
|
* A function to ensure the elements are within the requested size.
|
2020-12-06 09:32:22 +01:00
|
|
|
* 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
|
|
|
|
*/
|
2020-11-28 15:05:28 +01:00
|
|
|
public void size(int size);
|
|
|
|
|
2020-11-16 02:55:33 +01:00
|
|
|
#if !TYPE_OBJECT
|
2020-12-06 09:32:22 +01:00
|
|
|
|
|
|
|
/** {@inheritDoc}
|
2020-12-07 08:55:22 +01:00
|
|
|
* <p>This default implementation delegates to the corresponding type-specific function.
|
|
|
|
* @deprecated Please use the corresponding type-specific function instead.
|
2020-12-06 09:32:22 +01:00
|
|
|
*/
|
2020-11-16 02:55:33 +01:00
|
|
|
@Override
|
|
|
|
@Deprecated
|
|
|
|
public default boolean add(CLASS_TYPE e) {
|
|
|
|
return COLLECTION.super.add(e);
|
|
|
|
}
|
|
|
|
|
2020-12-06 09:32:22 +01:00
|
|
|
/** {@inheritDoc}
|
2020-12-07 08:55:22 +01:00
|
|
|
* <p>This default implementation delegates to the corresponding type-specific function.
|
|
|
|
* @deprecated Please use the corresponding type-specific function instead.
|
2020-12-06 09:32:22 +01:00
|
|
|
*/
|
2020-11-16 02:55:33 +01:00
|
|
|
@Override
|
|
|
|
@Deprecated
|
|
|
|
public default CLASS_TYPE get(int index) {
|
|
|
|
return KEY_TO_OBJ(GET_KEY(index));
|
|
|
|
}
|
|
|
|
|
2020-12-06 09:32:22 +01:00
|
|
|
/** {@inheritDoc}
|
2020-12-07 08:55:22 +01:00
|
|
|
* <p>This default implementation delegates to the corresponding type-specific function.
|
|
|
|
* @deprecated Please use the corresponding type-specific function instead.
|
2020-12-06 09:32:22 +01:00
|
|
|
*/
|
2020-11-16 02:55:33 +01:00
|
|
|
@Override
|
|
|
|
@Deprecated
|
|
|
|
public default CLASS_TYPE set(int index, CLASS_TYPE e) {
|
|
|
|
return KEY_TO_OBJ(set(index, OBJ_TO_KEY(e)));
|
|
|
|
}
|
|
|
|
|
2020-12-06 09:32:22 +01:00
|
|
|
/** {@inheritDoc}
|
2020-12-07 08:55:22 +01:00
|
|
|
* <p>This default implementation delegates to the corresponding type-specific function.
|
|
|
|
* @deprecated Please use the corresponding type-specific function instead.
|
2020-12-06 09:32:22 +01:00
|
|
|
*/
|
2020-11-16 02:55:33 +01:00
|
|
|
@Override
|
|
|
|
@Deprecated
|
|
|
|
public default int indexOf(Object o) {
|
|
|
|
return indexOf(CLASS_TO_KEY(o));
|
|
|
|
}
|
|
|
|
|
2020-12-06 09:32:22 +01:00
|
|
|
/** {@inheritDoc}
|
2020-12-07 08:55:22 +01:00
|
|
|
* <p>This default implementation delegates to the corresponding type-specific function.
|
|
|
|
* @deprecated Please use the corresponding type-specific function instead.
|
2020-12-06 09:32:22 +01:00
|
|
|
*/
|
2020-11-16 02:55:33 +01:00
|
|
|
@Override
|
|
|
|
@Deprecated
|
|
|
|
public default int lastIndexOf(Object o) {
|
2020-12-06 09:32:22 +01:00
|
|
|
return lastIndexOf(CLASS_TO_KEY(o));
|
2020-11-16 02:55:33 +01:00
|
|
|
}
|
|
|
|
|
2020-12-06 09:32:22 +01:00
|
|
|
/** {@inheritDoc}
|
2020-12-07 08:55:22 +01:00
|
|
|
* <p>This default implementation delegates to the corresponding type-specific function.
|
|
|
|
* @deprecated Please use the corresponding type-specific function instead.
|
2020-12-06 09:32:22 +01:00
|
|
|
*/
|
2020-11-16 02:55:33 +01:00
|
|
|
@Override
|
|
|
|
@Deprecated
|
|
|
|
public default boolean contains(Object o) {
|
|
|
|
return COLLECTION.super.contains(o);
|
|
|
|
}
|
|
|
|
|
2020-12-06 09:32:22 +01:00
|
|
|
/** {@inheritDoc}
|
2020-12-07 08:55:22 +01:00
|
|
|
* <p>This default implementation delegates to the corresponding type-specific function.
|
|
|
|
* @deprecated Please use the corresponding type-specific function instead.
|
2020-12-06 09:32:22 +01:00
|
|
|
*/
|
2020-11-16 02:55:33 +01:00
|
|
|
@Override
|
|
|
|
@Deprecated
|
|
|
|
public default boolean remove(Object o) {
|
|
|
|
return COLLECTION.super.remove(o);
|
|
|
|
}
|
|
|
|
|
2020-12-06 09:32:22 +01:00
|
|
|
/** {@inheritDoc}
|
2020-12-07 08:55:22 +01:00
|
|
|
* <p>This default implementation delegates to the corresponding type-specific function.
|
|
|
|
* @deprecated Please use the corresponding type-specific function instead.
|
2020-12-06 09:32:22 +01:00
|
|
|
*/
|
2020-11-16 02:55:33 +01:00
|
|
|
@Override
|
|
|
|
@Deprecated
|
|
|
|
public default CLASS_TYPE remove(int index) {
|
|
|
|
return KEY_TO_OBJ(REMOVE(index));
|
|
|
|
}
|
2020-11-30 00:11:40 +01:00
|
|
|
|
|
|
|
#if !TYPE_BOOLEAN
|
2020-12-06 09:32:22 +01:00
|
|
|
/** {@inheritDoc}
|
2020-12-07 08:55:22 +01:00
|
|
|
* <p>This default implementation delegates to the corresponding type-specific function.
|
|
|
|
* @deprecated Please use the corresponding type-specific function instead.
|
2020-12-06 09:32:22 +01:00
|
|
|
*/
|
2020-11-30 00:11:40 +01:00
|
|
|
@Override
|
|
|
|
@Deprecated
|
|
|
|
public default void replaceAll(UnaryOperator<CLASS_TYPE> o) {
|
|
|
|
Objects.requireNonNull(o);
|
|
|
|
#if TYPE_BYTE || TYPE_SHORT || TYPE_CHAR || TYPE_FLOAT
|
|
|
|
REPLACE(T -> OBJ_TO_KEY(o.apply(KEY_TO_OBJ((KEY_TYPE)T))));
|
|
|
|
#else
|
|
|
|
REPLACE(T -> OBJ_TO_KEY(o.apply(KEY_TO_OBJ(T))));
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
#endif
|
2020-11-16 02:55:33 +01:00
|
|
|
#endif
|
|
|
|
}
|