Version 0.7.0 Release
- Added: Coverage Badge - Updated: Changelog. - Changed: Changelog now has info how to obtain the sourcecode. - Added: Over 11 Million Unit Tests to this library to ensure quality. - Added: ArrayList size constructor now throws IllegalStateException if the size parameter is negative - Added: EnumMap specialized forEach implementation. - Added: AbstractMap.remove now delegates to its primitive counterpart. - Added: ConcurrentHashMap now implements ITrimmable - Refactor: Removed a lot of disabled code from ArraySet. - Removed: LinkedList.addAll(index, List) now delegates to LinkedList.addAll(index, Collection) due to no special optimization required. - Fixed: AbstractList.SubList.get/set/swapRemove didn't calculate their List index Properly - Fixed: AbstractList.SubList chains now properly if you create SubLists within SubLists. - Fixed: AbstractList.Iterator.add now respects Immutable/UnmodifiableLists. - Fixed: AbstractList.Iterator.skip/back now keep track of the last returned value for remove function to work properly. - Fixed: CopyOnWriteArrayList.extract/removeElements(int, int) does now proper range checks and remove elements properly. - Fixed: CopyOnWriteArrayList.SubList now works properly. (Reimplemented entirely) - Fixed: CopyOnWriteArrayList.Iterator.previous() was returning the wrong values. - Fixed: CopyOnWriteArrayList.Iterator.skip now skips the right amount of elements and stops where it should. - Fixed: LinkedList.first/last/dequeue/dequeueLast now throws NoSuchElementException when empty instead of IllegalStateException. - Fixed: LinkedList had an edge case where the entire reverse iterator would break if the wrong element was removed. - Fixed: LinkedList.extractElement now returns the correct values. - Fixed: AbstractMap.entrySet().remove(Object) now returns true if defaultReturnValue elements were removed. - Fixed: ConcurrentHashMap.remove(Object, Object) checks if the type matches before comparing against null Values. - Fixed: LinkedHashMap.clearAndTrim() was checking the wrong value for determining the full reset or clearing of a Map. - Fixed: HashMap.trim/clearToTrim() was using the wrong value to determin if something should be done. - Fixed: HashMap now compares empty values (0) against nullKeys when Object Variants of the type are used. - Fixed: ImmutableMap now compares empty values (0) against nullKeys when Object Variants of the type are used. - Fixed: ArrayMap.iterator(key) now throws NoSuchElementException when the element wasn't found. - Fixed: Linked/EnumMap array constructor was creating the wrong size values array. - Fixed: LinkedEnumMap.getAndMoveToFirst/Last was moving elements even if the element wasn't present. - Fixed: AVL/RBTreeMap.getFirst/LastKey was not throwing a NoSuchElementException if the map was empty. - Fixed: Map.Builder wasn't throwing a IllegalStateException when creating a negative size builder. - Fixed: AVL/RBTreeSet.DecendingSet.subSet(from, fromInclusive, to, toInclusive) was creating a corrupt asending subset. - Fixed: ArraySet throws now a IllegalStateException when trying to create it with a negative size. - Fixed: ArraySet.addMoveToLast(key) was crashing when a key was already present. - Fixed: Immutable/LinkedHashSet now keep track of their iteration index properly. - Fixed: LinkedHashSet.moveToFirst/Last(key) would crash if the Set was empty. - Fixed: LinkedHashSet.clearAndTrim() was checking the wrong value for determining the full reset or clearing of a Map. - Fixed: HashSet.trim/clearToTrim() was using the wrong value to determin if something should be done.
This commit is contained in:
+8
-8
@@ -110,7 +110,7 @@ public class LINKED_HASH_SET KEY_GENERIC_TYPE extends HASH_SET KEY_GENERIC_TYPE
|
||||
* @throws IllegalStateException if offset and length causes to step outside of the arrays range
|
||||
*/
|
||||
public LINKED_HASH_SET(KEY_TYPE[] array, int offset, int length, float loadFactor) {
|
||||
this(length < 0 ? 0 : length);
|
||||
this(length);
|
||||
SanityChecks.checkArrayCapacity(array.length, offset, length);
|
||||
for(int i = 0;i<length;i++) add(array[offset+i]);
|
||||
}
|
||||
@@ -255,7 +255,7 @@ public class LINKED_HASH_SET KEY_GENERIC_TYPE extends HASH_SET KEY_GENERIC_TYPE
|
||||
|
||||
@Override
|
||||
public boolean moveToFirst(KEY_TYPE o) {
|
||||
if(KEY_EQUALS(FIRST_KEY(), o)) return false;
|
||||
if(isEmpty() || KEY_EQUALS(FIRST_KEY(), o)) return false;
|
||||
if(KEY_EQUALS_NULL(o)) {
|
||||
if(containsNull) {
|
||||
moveToFirstIndex(nullIndex);
|
||||
@@ -277,7 +277,7 @@ public class LINKED_HASH_SET KEY_GENERIC_TYPE extends HASH_SET KEY_GENERIC_TYPE
|
||||
|
||||
@Override
|
||||
public boolean moveToLast(KEY_TYPE o) {
|
||||
if(KEY_EQUALS(LAST_KEY(), o)) return false;
|
||||
if(isEmpty() || KEY_EQUALS(LAST_KEY(), o)) return false;
|
||||
if(KEY_EQUALS_NULL(o)) {
|
||||
if(containsNull) {
|
||||
moveToLastIndex(nullIndex);
|
||||
@@ -343,8 +343,7 @@ public class LINKED_HASH_SET KEY_GENERIC_TYPE extends HASH_SET KEY_GENERIC_TYPE
|
||||
public KEY_TYPE POLL_FIRST_KEY() {
|
||||
if(size == 0) throw new NoSuchElementException();
|
||||
int pos = firstIndex;
|
||||
firstIndex = (int)links[pos];
|
||||
if(0 <= firstIndex) links[firstIndex] |= 0xFFFFFFFF00000000L;
|
||||
onNodeRemoved(pos);
|
||||
KEY_TYPE result = keys[pos];
|
||||
size--;
|
||||
if(KEY_EQUALS_NULL(result)) {
|
||||
@@ -366,8 +365,7 @@ public class LINKED_HASH_SET KEY_GENERIC_TYPE extends HASH_SET KEY_GENERIC_TYPE
|
||||
public KEY_TYPE POLL_LAST_KEY() {
|
||||
if(size == 0) throw new NoSuchElementException();
|
||||
int pos = lastIndex;
|
||||
lastIndex = (int)(links[pos] >>> 32);
|
||||
if(0 <= lastIndex) links[lastIndex] |= 0xFFFFFFFFL;
|
||||
onNodeRemoved(pos);
|
||||
KEY_TYPE result = keys[pos];
|
||||
size--;
|
||||
if(KEY_EQUALS_NULL(result)) {
|
||||
@@ -601,7 +599,7 @@ public class LINKED_HASH_SET KEY_GENERIC_TYPE extends HASH_SET KEY_GENERIC_TYPE
|
||||
@Override
|
||||
public void clearAndTrim(int size) {
|
||||
int request = Math.max(minCapacity, HashUtil.nextPowerOfTwo((int)Math.ceil(size / loadFactor)));
|
||||
if(request >= size) {
|
||||
if(request >= nullIndex) {
|
||||
clear();
|
||||
return;
|
||||
}
|
||||
@@ -686,6 +684,7 @@ public class LINKED_HASH_SET KEY_GENERIC_TYPE extends HASH_SET KEY_GENERIC_TYPE
|
||||
next = (int)(links[current]);
|
||||
result++;
|
||||
}
|
||||
if(index >= 0) index+=result;
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -697,6 +696,7 @@ public class LINKED_HASH_SET KEY_GENERIC_TYPE extends HASH_SET KEY_GENERIC_TYPE
|
||||
previous = (int)(links[current] >> 32);
|
||||
result++;
|
||||
}
|
||||
if(index >= 0) index-=result;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user