From bc7afad793533689828241ead51da236aa231108 Mon Sep 17 00:00:00 2001 From: Speiger Date: Mon, 20 Sep 2021 00:52:23 +0200 Subject: [PATCH] Last Minute Fixes --- build.gradle | 2 +- .../templates/maps/impl/tree/AVLTreeMap.template | 4 ++-- .../templates/maps/impl/tree/RBTreeMap.template | 8 ++++---- .../templates/misc/pairs/impl/ImmutablePair.template | 4 ++++ .../templates/misc/pairs/impl/MutablePair.template | 6 ++++++ 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/build.gradle b/build.gradle index 0464239..d4d1583 100644 --- a/build.gradle +++ b/build.gradle @@ -18,7 +18,7 @@ repositories { } archivesBaseName = 'Primitive Collections' -version = '0.3.6'; +version = '0.4.0'; sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' diff --git a/src/builder/resources/speiger/assets/collections/templates/maps/impl/tree/AVLTreeMap.template b/src/builder/resources/speiger/assets/collections/templates/maps/impl/tree/AVLTreeMap.template index 7433383..262d4a5 100644 --- a/src/builder/resources/speiger/assets/collections/templates/maps/impl/tree/AVLTreeMap.template +++ b/src/builder/resources/speiger/assets/collections/templates/maps/impl/tree/AVLTreeMap.template @@ -1023,13 +1023,13 @@ public class AVL_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_ public MAP.Entry KEY_VALUE_GENERIC_TYPE higherEntry(KEY_TYPE e) { return super.lowerEntry(e); } protected AVL_TREE_MAP.Entry KEY_VALUE_GENERIC_TYPE findLowest() { - if(fromStart) return m.last; + if(fromStart) return m.first; AVL_TREE_MAP.Entry KEY_VALUE_GENERIC_TYPE entry = loInclusive ? m.findFloorNode(high) : m.findLowerNode(high); return entry == null || tooHigh(entry.key) ? null : entry; } protected AVL_TREE_MAP.Entry KEY_VALUE_GENERIC_TYPE findHighest() { - if(toEnd) return m.first; + if(toEnd) return m.last; AVL_TREE_MAP.Entry KEY_VALUE_GENERIC_TYPE entry = hiInclusive ? m.findCeilingNode(low) : m.findHigherNode(low); return entry == null || tooLow(entry.key) ? null : entry; } diff --git a/src/builder/resources/speiger/assets/collections/templates/maps/impl/tree/RBTreeMap.template b/src/builder/resources/speiger/assets/collections/templates/maps/impl/tree/RBTreeMap.template index d34efa7..f03ed88 100644 --- a/src/builder/resources/speiger/assets/collections/templates/maps/impl/tree/RBTreeMap.template +++ b/src/builder/resources/speiger/assets/collections/templates/maps/impl/tree/RBTreeMap.template @@ -1077,14 +1077,14 @@ public class RB_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_G public MAP.Entry KEY_VALUE_GENERIC_TYPE higherEntry(KEY_TYPE e) { return super.lowerEntry(e); } protected RB_TREE_MAP.Entry KEY_VALUE_GENERIC_TYPE findLowest() { - if(fromStart) return m.last; - RB_TREE_MAP.Entry KEY_VALUE_GENERIC_TYPE entry = loInclusive ? m.findFloorNode(high) : m.findLowerNode(high); + if(fromStart) return m.first; + RB_TREE_MAP.Entry KEY_VALUE_GENERIC_TYPE entry = loInclusive ? m.findCeilingNode(low) : m.findHigherNode(low); return entry == null || tooHigh(entry.key) ? null : entry; } protected RB_TREE_MAP.Entry KEY_VALUE_GENERIC_TYPE findHighest() { - if(toEnd) return m.first; - RB_TREE_MAP.Entry KEY_VALUE_GENERIC_TYPE entry = hiInclusive ? m.findCeilingNode(low) : m.findHigherNode(low); + if(toEnd) return m.last; + RB_TREE_MAP.Entry KEY_VALUE_GENERIC_TYPE entry = hiInclusive ? m.findFloorNode(high) : m.findLowerNode(high); return entry == null || tooLow(entry.key) ? null : entry; } diff --git a/src/builder/resources/speiger/assets/collections/templates/misc/pairs/impl/ImmutablePair.template b/src/builder/resources/speiger/assets/collections/templates/misc/pairs/impl/ImmutablePair.template index fb78982..fd81f4e 100644 --- a/src/builder/resources/speiger/assets/collections/templates/misc/pairs/impl/ImmutablePair.template +++ b/src/builder/resources/speiger/assets/collections/templates/misc/pairs/impl/ImmutablePair.template @@ -1,5 +1,9 @@ package speiger.src.collections.PACKAGE.misc.pairs.impl; +#if TYPE_OBJECT || VALUE_OBJECT +import java.util.Objects; +#endif + import speiger.src.collections.PACKAGE.misc.pairs.PAIR; /** diff --git a/src/builder/resources/speiger/assets/collections/templates/misc/pairs/impl/MutablePair.template b/src/builder/resources/speiger/assets/collections/templates/misc/pairs/impl/MutablePair.template index c8bbce2..f58a005 100644 --- a/src/builder/resources/speiger/assets/collections/templates/misc/pairs/impl/MutablePair.template +++ b/src/builder/resources/speiger/assets/collections/templates/misc/pairs/impl/MutablePair.template @@ -1,7 +1,13 @@ package speiger.src.collections.PACKAGE.misc.pairs.impl; +#if TYPE_OBJECT || VALUE_OBJECT +import java.util.Objects; +#endif + import speiger.src.collections.PACKAGE.misc.pairs.PAIR; + + /** * Mutable Pair Implementation that * @Type(T)