New Features and bugfixes.

- Fixed: AbstractCollection bulk adding methods now link to the
specialized implementations.
- Fixed: A bug with getElements in ArrayList.
- Fixed: PriorityQueue remove/toArray function were renamed so they fit
better with other interfaces. (remove => removeFirst and toArray uses a
different genericType)
- Added: LinkedList which is a List/PriorityDequeue/Stack which allows
for more optimized use-cases and reduced boxing/unboxing.
- Added: Tests for LinkedList
This commit is contained in:
2021-08-12 14:31:29 +02:00
parent 73916f4fd9
commit 45d118a77a
13 changed files with 1182 additions and 23 deletions
@@ -2,7 +2,9 @@ package speiger.src.collections.PACKAGE.utils;
import java.util.Iterator;
import java.util.NoSuchElementException;
#if TYPE_OBJECT
import java.util.function.Function;
#endif
import speiger.src.collections.PACKAGE.collections.ITERATOR;
import speiger.src.collections.PACKAGE.lists.ARRAY_LIST;
@@ -91,7 +91,7 @@ public class PRIORITY_QUEUES
@Override
public KEY_TYPE peek(int index) { synchronized(mutex) { return queue.peek(index); } }
@Override
public boolean remove(KEY_TYPE e) { synchronized(mutex) { return queue.remove(e); } }
public boolean removeFirst(KEY_TYPE e) { synchronized(mutex) { return queue.removeFirst(e); } }
@Override
public boolean removeLast(KEY_TYPE e) { synchronized(mutex) { return queue.removeLast(e); } }
@Override
@@ -99,7 +99,7 @@ public class PRIORITY_QUEUES
@Override
public COMPARATOR KEY_SUPER_GENERIC_TYPE comparator() { synchronized(mutex) { return queue.comparator(); } }
@Override
public KEY_TYPE[] TO_ARRAY(KEY_TYPE[] input) { synchronized(mutex) { return queue.TO_ARRAY(input); } }
public KEY_GENERIC_SPECIAL_TYPE KEY_SPECIAL_TYPE[] TO_ARRAY(KEY_SPECIAL_TYPE[] input) { synchronized(mutex) { return queue.TO_ARRAY(input); } }
}
/**