diff --git a/.gitignore b/.gitignore index 94da798..b86ee6b 100644 --- a/.gitignore +++ b/.gitignore @@ -14,30 +14,9 @@ gradle-app.setting # # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 # gradle/wrapper/gradle-wrapper.properties -# ---> Java -# Compiled class file -*.class - -# Log file -*.log - -# BlueJ files -*.ctxt - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.nar -*.ear -*.zip -*.tar.gz -*.rar - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* +.classpath +.project +gradle-wrapper.jar ---> Custom !/libs/ @@ -56,4 +35,4 @@ hs_err_pid* /src/main/java/speiger/src/collections/objects/* #Cache result -/src/main/resources/speiger/assets/collections/cache.bin \ No newline at end of file +/src/builder/resources/speiger/assets/collections/cache.bin \ No newline at end of file diff --git a/README.md b/README.md index 280bdd7..b44df6a 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,14 @@ ArraysList, HashSet/Map (Linked & HashControl), TreeSet/Map (RB & AVL), Priority # Guide -Project is currently not buildable due to certain design flaws that are being redone, -but the SourceCode can be already generated via: /gradlew.bat generateSource -which will generate all the files and they shouldn't generate any errors. +The SourceCode can be already generated via: +/gradlew.bat generateSource +to build the jar +/gradlew.bat build +do not combine the commands because they can not be executed at the same time. Current Problem: EnumMaps use sun.misc package. -Some methods are ambiguous and need to be adjusted. Some overhauls or missing implementations have to be added. (A couple passes) But technically Lists/Sets/PriorityQueues are fully usable, Maps are untested and just recently added. diff --git a/build.gradle b/build.gradle index 1a3c8f7..79fcc6c 100644 --- a/build.gradle +++ b/build.gradle @@ -12,7 +12,7 @@ apply plugin: 'eclipse' repositories { jcenter() flatDir { - dirs '/libs' + dirs 'libs' } } @@ -31,11 +31,12 @@ eclipse { } } -task generateSource(type: JavaExec) { - group = 'internal' - description = 'Builds the sourcecode' - classpath = sourceSets.main.runtimeClasspath - main = 'speiger.src.builder.example.TestBuilder' +sourceSets { + builder +} + +configurations { + builderCompile.extendsFrom compile } dependencies { @@ -43,6 +44,30 @@ dependencies { testImplementation 'junit:junit:4.12' } +task generateSource(type: JavaExec) { + group = 'internal' + description = 'Builds the sourcecode' + classpath = sourceSets.builder.runtimeClasspath + main = 'speiger.src.builder.PrimitiveCollectionsBuilder' +} + +task javadocJar(type: Jar) { + from javadoc + classifier = 'javadoc' +} + +task srcJar(type: Jar) { + from sourceSets.main.allSource + classifier = 'sources' +} + +javadoc.failOnError = false + +artifacts { + archives javadocJar + archives srcJar +} + test { useJUnit() } \ No newline at end of file diff --git a/src/main/java/speiger/src/builder/example/ClassType.java b/src/builder/java/speiger/src/builder/ClassType.java similarity index 99% rename from src/main/java/speiger/src/builder/example/ClassType.java rename to src/builder/java/speiger/src/builder/ClassType.java index a5a8381..bdabca8 100644 --- a/src/main/java/speiger/src/builder/example/ClassType.java +++ b/src/builder/java/speiger/src/builder/ClassType.java @@ -1,4 +1,4 @@ -package speiger.src.builder.example; +package speiger.src.builder; public enum ClassType { diff --git a/src/main/java/speiger/src/builder/example/GlobalVariables.java b/src/builder/java/speiger/src/builder/GlobalVariables.java similarity index 99% rename from src/main/java/speiger/src/builder/example/GlobalVariables.java rename to src/builder/java/speiger/src/builder/GlobalVariables.java index 78ef5e1..b884464 100644 --- a/src/main/java/speiger/src/builder/example/GlobalVariables.java +++ b/src/builder/java/speiger/src/builder/GlobalVariables.java @@ -1,4 +1,4 @@ -package speiger.src.builder.example; +package speiger.src.builder; import java.nio.file.Path; import java.util.ArrayList; diff --git a/src/main/java/speiger/src/builder/example/TestBuilder.java b/src/builder/java/speiger/src/builder/PrimitiveCollectionsBuilder.java similarity index 87% rename from src/main/java/speiger/src/builder/example/TestBuilder.java rename to src/builder/java/speiger/src/builder/PrimitiveCollectionsBuilder.java index 401d0af..74908f4 100644 --- a/src/main/java/speiger/src/builder/example/TestBuilder.java +++ b/src/builder/java/speiger/src/builder/PrimitiveCollectionsBuilder.java @@ -1,4 +1,4 @@ -package speiger.src.builder.example; +package speiger.src.builder; import java.io.IOException; import java.nio.file.Path; @@ -15,7 +15,7 @@ import java.util.function.Consumer; import speiger.src.builder.processor.TemplateProcess; import speiger.src.builder.processor.TemplateProcessor; -public class TestBuilder extends TemplateProcessor +public class PrimitiveCollectionsBuilder extends TemplateProcessor { Map> blocked = new HashMap<>(); Map nameRemapper = new HashMap<>(); @@ -26,12 +26,12 @@ public class TestBuilder extends TemplateProcessor List biVariables = new ArrayList<>(); List enumVariables = new ArrayList<>(); - public TestBuilder() + public PrimitiveCollectionsBuilder() { - super(Paths.get("src/main/resources/speiger/assets/collections/templates/"), Paths.get("src/main/java/speiger/src/collections/"), Paths.get("src/main/resources/speiger/assets/collections/")); + super(Paths.get("src/builder/resources/speiger/assets/collections/templates/"), Paths.get("src/main/java/speiger/src/collections/"), Paths.get("src/builder/resources/speiger/assets/collections/")); } - public TestBuilder(Path sourceFolder, Path outputFolder, Path dataFolder) + public PrimitiveCollectionsBuilder(Path sourceFolder, Path outputFolder, Path dataFolder) { super(sourceFolder, outputFolder, dataFolder); } @@ -145,9 +145,9 @@ public class TestBuilder extends TemplateProcessor try { if(args.length == 0) { - new TestBuilder().process(false); + new PrimitiveCollectionsBuilder().process(false); } else if(args.length == 3) { - new TestBuilder(Paths.get(args[0]), Paths.get(args[1]), Paths.get(args[2])).process(false); + new PrimitiveCollectionsBuilder(Paths.get(args[0]), Paths.get(args[1]), Paths.get(args[2])).process(false); } else { System.out.println("Invalid argument count passed in"); System.exit(1); diff --git a/src/main/resources/speiger/assets/collections/templates/collections/AbstractCollection.template b/src/builder/resources/speiger/assets/collections/templates/collections/AbstractCollection.template similarity index 100% rename from src/main/resources/speiger/assets/collections/templates/collections/AbstractCollection.template rename to src/builder/resources/speiger/assets/collections/templates/collections/AbstractCollection.template diff --git a/src/main/resources/speiger/assets/collections/templates/collections/BidirectionalIterator.template b/src/builder/resources/speiger/assets/collections/templates/collections/BidirectionalIterator.template similarity index 100% rename from src/main/resources/speiger/assets/collections/templates/collections/BidirectionalIterator.template rename to src/builder/resources/speiger/assets/collections/templates/collections/BidirectionalIterator.template diff --git a/src/main/resources/speiger/assets/collections/templates/collections/Collection.template b/src/builder/resources/speiger/assets/collections/templates/collections/Collection.template similarity index 100% rename from src/main/resources/speiger/assets/collections/templates/collections/Collection.template rename to src/builder/resources/speiger/assets/collections/templates/collections/Collection.template diff --git a/src/main/resources/speiger/assets/collections/templates/collections/Iterable.template b/src/builder/resources/speiger/assets/collections/templates/collections/Iterable.template similarity index 100% rename from src/main/resources/speiger/assets/collections/templates/collections/Iterable.template rename to src/builder/resources/speiger/assets/collections/templates/collections/Iterable.template diff --git a/src/main/resources/speiger/assets/collections/templates/collections/Iterator.template b/src/builder/resources/speiger/assets/collections/templates/collections/Iterator.template similarity index 100% rename from src/main/resources/speiger/assets/collections/templates/collections/Iterator.template rename to src/builder/resources/speiger/assets/collections/templates/collections/Iterator.template diff --git a/src/main/resources/speiger/assets/collections/templates/collections/Stack.template b/src/builder/resources/speiger/assets/collections/templates/collections/Stack.template similarity index 100% rename from src/main/resources/speiger/assets/collections/templates/collections/Stack.template rename to src/builder/resources/speiger/assets/collections/templates/collections/Stack.template diff --git a/src/main/resources/speiger/assets/collections/templates/functions/Comparator.template b/src/builder/resources/speiger/assets/collections/templates/functions/Comparator.template similarity index 100% rename from src/main/resources/speiger/assets/collections/templates/functions/Comparator.template rename to src/builder/resources/speiger/assets/collections/templates/functions/Comparator.template diff --git a/src/main/resources/speiger/assets/collections/templates/functions/Consumer.template b/src/builder/resources/speiger/assets/collections/templates/functions/Consumer.template similarity index 100% rename from src/main/resources/speiger/assets/collections/templates/functions/Consumer.template rename to src/builder/resources/speiger/assets/collections/templates/functions/Consumer.template diff --git a/src/main/resources/speiger/assets/collections/templates/functions/consumer/BiConsumer.template b/src/builder/resources/speiger/assets/collections/templates/functions/consumer/BiConsumer.template similarity index 100% rename from src/main/resources/speiger/assets/collections/templates/functions/consumer/BiConsumer.template rename to src/builder/resources/speiger/assets/collections/templates/functions/consumer/BiConsumer.template diff --git a/src/main/resources/speiger/assets/collections/templates/functions/function/Function.template b/src/builder/resources/speiger/assets/collections/templates/functions/function/Function.template similarity index 100% rename from src/main/resources/speiger/assets/collections/templates/functions/function/Function.template rename to src/builder/resources/speiger/assets/collections/templates/functions/function/Function.template diff --git a/src/main/resources/speiger/assets/collections/templates/functions/function/UnaryOperator.template b/src/builder/resources/speiger/assets/collections/templates/functions/function/UnaryOperator.template similarity index 100% rename from src/main/resources/speiger/assets/collections/templates/functions/function/UnaryOperator.template rename to src/builder/resources/speiger/assets/collections/templates/functions/function/UnaryOperator.template diff --git a/src/main/resources/speiger/assets/collections/templates/lists/AbstractList.template b/src/builder/resources/speiger/assets/collections/templates/lists/AbstractList.template similarity index 100% rename from src/main/resources/speiger/assets/collections/templates/lists/AbstractList.template rename to src/builder/resources/speiger/assets/collections/templates/lists/AbstractList.template diff --git a/src/main/resources/speiger/assets/collections/templates/lists/ArrayList.template b/src/builder/resources/speiger/assets/collections/templates/lists/ArrayList.template similarity index 100% rename from src/main/resources/speiger/assets/collections/templates/lists/ArrayList.template rename to src/builder/resources/speiger/assets/collections/templates/lists/ArrayList.template diff --git a/src/main/resources/speiger/assets/collections/templates/lists/List.template b/src/builder/resources/speiger/assets/collections/templates/lists/List.template similarity index 100% rename from src/main/resources/speiger/assets/collections/templates/lists/List.template rename to src/builder/resources/speiger/assets/collections/templates/lists/List.template diff --git a/src/main/resources/speiger/assets/collections/templates/lists/ListIterator.template b/src/builder/resources/speiger/assets/collections/templates/lists/ListIterator.template similarity index 100% rename from src/main/resources/speiger/assets/collections/templates/lists/ListIterator.template rename to src/builder/resources/speiger/assets/collections/templates/lists/ListIterator.template diff --git a/src/main/resources/speiger/assets/collections/templates/maps/abstracts/AbstractMap.template b/src/builder/resources/speiger/assets/collections/templates/maps/abstracts/AbstractMap.template similarity index 97% rename from src/main/resources/speiger/assets/collections/templates/maps/abstracts/AbstractMap.template rename to src/builder/resources/speiger/assets/collections/templates/maps/abstracts/AbstractMap.template index 0ccc4f7..cfdbe3d 100644 --- a/src/main/resources/speiger/assets/collections/templates/maps/abstracts/AbstractMap.template +++ b/src/builder/resources/speiger/assets/collections/templates/maps/abstracts/AbstractMap.template @@ -180,8 +180,8 @@ public abstract class ABSTRACT_MAP KEY_VALUE_GENERIC_TYPE extends AbstractMap ENTRY_SET() { if(entrySet == null) entrySet = new MapEntrySet(); diff --git a/src/main/resources/speiger/assets/collections/templates/maps/impl/hash/LinkedOpenHashMap.template b/src/builder/resources/speiger/assets/collections/templates/maps/impl/hash/LinkedOpenHashMap.template similarity index 100% rename from src/main/resources/speiger/assets/collections/templates/maps/impl/hash/LinkedOpenHashMap.template rename to src/builder/resources/speiger/assets/collections/templates/maps/impl/hash/LinkedOpenHashMap.template diff --git a/src/main/resources/speiger/assets/collections/templates/maps/impl/hash/OpenHashMap.template b/src/builder/resources/speiger/assets/collections/templates/maps/impl/hash/OpenHashMap.template similarity index 99% rename from src/main/resources/speiger/assets/collections/templates/maps/impl/hash/OpenHashMap.template rename to src/builder/resources/speiger/assets/collections/templates/maps/impl/hash/OpenHashMap.template index 06b9b27..b7077c2 100644 --- a/src/main/resources/speiger/assets/collections/templates/maps/impl/hash/OpenHashMap.template +++ b/src/builder/resources/speiger/assets/collections/templates/maps/impl/hash/OpenHashMap.template @@ -253,20 +253,21 @@ public class HASH_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GENE return VALUE_TO_OBJ(slot < 0 ? getDefaultReturnValue() : values[slot]); } -#if !TYPE_OBJECT +#if TYPE_OBJECT && VALUE_OBJECT + @Override + public VALUE_TYPE getOrDefault(Object key, VALUE_TYPE defaultValue) { + int slot = findIndex(key); + return slot < 0 ? defaultValue : values[slot]; + } + +#else @Override public VALUE_TYPE getOrDefault(KEY_TYPE key, VALUE_TYPE defaultValue) { int slot = findIndex(key); return slot < 0 ? defaultValue : values[slot]; } -#endif - @Override - public CLASS_VALUE_TYPE getOrDefault(Object key, CLASS_VALUE_TYPE defaultValue) { - int slot = findIndex(key); - return slot < 0 ? defaultValue : VALUE_TO_OBJ(values[slot]); - } - +#endif @Override public ObjectSet ENTRY_SET() { if(entrySet == null) entrySet = new MapEntrySet(); diff --git a/src/main/resources/speiger/assets/collections/templates/maps/impl/misc/ArrayMap.template b/src/builder/resources/speiger/assets/collections/templates/maps/impl/misc/ArrayMap.template similarity index 98% rename from src/main/resources/speiger/assets/collections/templates/maps/impl/misc/ArrayMap.template rename to src/builder/resources/speiger/assets/collections/templates/maps/impl/misc/ArrayMap.template index 745c0bb..39d7b54 100644 --- a/src/main/resources/speiger/assets/collections/templates/maps/impl/misc/ArrayMap.template +++ b/src/builder/resources/speiger/assets/collections/templates/maps/impl/misc/ArrayMap.template @@ -153,7 +153,14 @@ public class ARRAY_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GEN return index < 0 ? getDefaultReturnValue() : values[index]; } -#if !TYPE_OBJECT +#if TYPE_OBJECT + @Override + public VALUE_TYPE getOrDefault(Object key, VALUE_TYPE defaultValue) { + int index = findIndex(key); + return index < 0 ? defaultValue : values[index]; + } + +#else @Override public VALUE_TYPE getOrDefault(KEY_TYPE key, VALUE_TYPE defaultValue) { int index = findIndex(key); @@ -161,12 +168,6 @@ public class ARRAY_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GEN } #endif - @Override - public CLASS_VALUE_TYPE getOrDefault(Object key, CLASS_VALUE_TYPE defaultValue) { - int index = findIndex(key); - return index < 0 ? defaultValue : VALUE_TO_OBJ(values[index]); - } - @Override public VALUE_TYPE getAndMoveToFirst(KEY_TYPE key) { int index = findIndex(key); @@ -564,7 +565,14 @@ public class ARRAY_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GEN return index < 0 ? getDefaultReturnValue() : values[index]; } -#if !TYPE_OBJECT +#if TYPE_OBJECT && VALUE_OBJECT + @Override + public VALUE_TYPE getOrDefault(Object key, VALUE_TYPE defaultValue) { + int index = findIndex(key); + return index < 0 ? defaultValue : values[index]; + } + +#else @Override public VALUE_TYPE getOrDefault(KEY_TYPE key, VALUE_TYPE defaultValue) { int index = findIndex(key); @@ -572,18 +580,6 @@ public class ARRAY_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GEN } #endif - @Override - public CLASS_VALUE_TYPE get(Object key) { - int index = findIndex(key); - return VALUE_TO_OBJ(index < 0 ? getDefaultReturnValue() : values[index]); - } - - @Override - public CLASS_VALUE_TYPE getOrDefault(Object key, CLASS_VALUE_TYPE defaultValue) { - int index = findIndex(key); - return index < 0 ? defaultValue : VALUE_TO_OBJ(values[index]); - } - @Override public VALUE_TYPE getAndMoveToFirst(KEY_TYPE key) { int index = findIndex(key); diff --git a/src/main/resources/speiger/assets/collections/templates/maps/impl/misc/EnumMap.template b/src/builder/resources/speiger/assets/collections/templates/maps/impl/misc/EnumMap.template similarity index 97% rename from src/main/resources/speiger/assets/collections/templates/maps/impl/misc/EnumMap.template rename to src/builder/resources/speiger/assets/collections/templates/maps/impl/misc/EnumMap.template index 6c078c8..95c40ee 100644 --- a/src/main/resources/speiger/assets/collections/templates/maps/impl/misc/EnumMap.template +++ b/src/builder/resources/speiger/assets/collections/templates/maps/impl/misc/EnumMap.template @@ -16,7 +16,7 @@ import speiger.src.collections.objects.maps.abstracts.ABSTRACT_MAP; import speiger.src.collections.objects.maps.interfaces.MAP; import speiger.src.collections.objects.sets.AbstractObjectSet; import speiger.src.collections.objects.sets.ObjectSet; -import sun.misc.SharedSecrets; +//import sun.misc.SharedSecrets; public class ENUM_MAP KEY_ENUM_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_GENERIC_TYPE { @@ -182,7 +182,10 @@ public class ENUM_MAP KEY_ENUM_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE onNodeRemoved(index); } protected boolean isSet(int index) { return (present[index >> 6] & (1L << index)) != 0; } - private static > K[] getKeyUniverse(Class keyType) { return SharedSecrets.getJavaLangAccess().getEnumConstantsShared(keyType); } + private static > K[] getKeyUniverse(Class keyType) { + return keyType.getEnumConstants(); +// return SharedSecrets.getJavaLangAccess().getEnumConstantsShared(keyType); + } class EntrySet extends AbstractObjectSet { diff --git a/src/main/resources/speiger/assets/collections/templates/maps/impl/tree/AVLTreeMap.template b/src/builder/resources/speiger/assets/collections/templates/maps/impl/tree/AVLTreeMap.template similarity index 99% rename from src/main/resources/speiger/assets/collections/templates/maps/impl/tree/AVLTreeMap.template rename to src/builder/resources/speiger/assets/collections/templates/maps/impl/tree/AVLTreeMap.template index 20c9f48..4af2047 100644 --- a/src/main/resources/speiger/assets/collections/templates/maps/impl/tree/AVLTreeMap.template +++ b/src/builder/resources/speiger/assets/collections/templates/maps/impl/tree/AVLTreeMap.template @@ -213,7 +213,7 @@ public class AVL_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_ return node == null ? getDefaultReturnValue() : node.value; } -#if TYPE_OBJECT +#if TYPE_OBJECT && VALUE_OBJECT @Override public VALUE_TYPE getOrDefault(Object key, VALUE_TYPE defaultValue) { Entry KEY_VALUE_GENERIC_TYPE node = findNode((CLASS_TYPE)key); @@ -918,6 +918,19 @@ public class AVL_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_ return inRange(key) ? m.GET_VALUE(key) : getDefaultReturnValue(); } +#if TYPE_OBJECT && VALUE_OBJECT + @Override + public VALUE_TYPE getOrDefault(Object key, VALUE_TYPE defaultValue) { + return inRange((KEY_TYPE)key) ? m.getOrDefault(key, defaultValue) : getDefaultReturnValue(); + } + +#else + @Override + public VALUE_TYPE getOrDefault(KEY_TYPE key, VALUE_TYPE defaultValue) { + return inRange(key) ? m.getOrDefault(key, defaultValue) : getDefaultReturnValue(); + } + +#endif @Override public VALUE_TYPE REMOVE_KEY(KEY_TYPE key) { return inRange(key) ? m.remove(key) : getDefaultReturnValue(); diff --git a/src/main/resources/speiger/assets/collections/templates/maps/impl/tree/RBTreeMap.template b/src/builder/resources/speiger/assets/collections/templates/maps/impl/tree/RBTreeMap.template similarity index 99% rename from src/main/resources/speiger/assets/collections/templates/maps/impl/tree/RBTreeMap.template rename to src/builder/resources/speiger/assets/collections/templates/maps/impl/tree/RBTreeMap.template index 4117087..83271b4 100644 --- a/src/main/resources/speiger/assets/collections/templates/maps/impl/tree/RBTreeMap.template +++ b/src/builder/resources/speiger/assets/collections/templates/maps/impl/tree/RBTreeMap.template @@ -212,7 +212,7 @@ public class RB_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_G return node == null ? getDefaultReturnValue() : node.value; } -#if TYPE_OBJECT +#if TYPE_OBJECT && VALUE_OBJECT @Override public VALUE_TYPE getOrDefault(Object key, VALUE_TYPE defaultValue) { Entry KEY_VALUE_GENERIC_TYPE node = findNode((CLASS_TYPE)key); @@ -975,6 +975,19 @@ public class RB_TREE_MAP KEY_VALUE_GENERIC_TYPE extends ABSTRACT_MAP KEY_VALUE_G return inRange(key) ? m.GET_VALUE(key) : getDefaultReturnValue(); } +#if TYPE_OBJECT && VALUE_OBJECT + @Override + public VALUE_TYPE getOrDefault(Object key, VALUE_TYPE defaultValue) { + return inRange((KEY_TYPE)key) ? m.getOrDefault(key, defaultValue) : getDefaultReturnValue(); + } + +#else + @Override + public VALUE_TYPE getOrDefault(KEY_TYPE key, VALUE_TYPE defaultValue) { + return inRange(key) ? m.getOrDefault(key, defaultValue) : getDefaultReturnValue(); + } + +#endif @Override public VALUE_TYPE REMOVE_KEY(KEY_TYPE key) { return inRange(key) ? m.remove(key) : getDefaultReturnValue(); diff --git a/src/main/resources/speiger/assets/collections/templates/maps/interfaces/Map.template b/src/builder/resources/speiger/assets/collections/templates/maps/interfaces/Map.template similarity index 100% rename from src/main/resources/speiger/assets/collections/templates/maps/interfaces/Map.template rename to src/builder/resources/speiger/assets/collections/templates/maps/interfaces/Map.template diff --git a/src/main/resources/speiger/assets/collections/templates/maps/interfaces/NavigableMap.template b/src/builder/resources/speiger/assets/collections/templates/maps/interfaces/NavigableMap.template similarity index 100% rename from src/main/resources/speiger/assets/collections/templates/maps/interfaces/NavigableMap.template rename to src/builder/resources/speiger/assets/collections/templates/maps/interfaces/NavigableMap.template diff --git a/src/main/resources/speiger/assets/collections/templates/maps/interfaces/SortedMap.template b/src/builder/resources/speiger/assets/collections/templates/maps/interfaces/SortedMap.template similarity index 100% rename from src/main/resources/speiger/assets/collections/templates/maps/interfaces/SortedMap.template rename to src/builder/resources/speiger/assets/collections/templates/maps/interfaces/SortedMap.template diff --git a/src/main/resources/speiger/assets/collections/templates/queues/ArrayFIFOQueue.template b/src/builder/resources/speiger/assets/collections/templates/queues/ArrayFIFOQueue.template similarity index 100% rename from src/main/resources/speiger/assets/collections/templates/queues/ArrayFIFOQueue.template rename to src/builder/resources/speiger/assets/collections/templates/queues/ArrayFIFOQueue.template diff --git a/src/main/resources/speiger/assets/collections/templates/queues/ArrayPriorityQueue.template b/src/builder/resources/speiger/assets/collections/templates/queues/ArrayPriorityQueue.template similarity index 100% rename from src/main/resources/speiger/assets/collections/templates/queues/ArrayPriorityQueue.template rename to src/builder/resources/speiger/assets/collections/templates/queues/ArrayPriorityQueue.template diff --git a/src/main/resources/speiger/assets/collections/templates/queues/HeapPriorityQueue.template b/src/builder/resources/speiger/assets/collections/templates/queues/HeapPriorityQueue.template similarity index 100% rename from src/main/resources/speiger/assets/collections/templates/queues/HeapPriorityQueue.template rename to src/builder/resources/speiger/assets/collections/templates/queues/HeapPriorityQueue.template diff --git a/src/main/resources/speiger/assets/collections/templates/queues/PriorityDequeue.template b/src/builder/resources/speiger/assets/collections/templates/queues/PriorityDequeue.template similarity index 100% rename from src/main/resources/speiger/assets/collections/templates/queues/PriorityDequeue.template rename to src/builder/resources/speiger/assets/collections/templates/queues/PriorityDequeue.template diff --git a/src/main/resources/speiger/assets/collections/templates/queues/PriorityQueue.template b/src/builder/resources/speiger/assets/collections/templates/queues/PriorityQueue.template similarity index 100% rename from src/main/resources/speiger/assets/collections/templates/queues/PriorityQueue.template rename to src/builder/resources/speiger/assets/collections/templates/queues/PriorityQueue.template diff --git a/src/main/resources/speiger/assets/collections/templates/sets/AVLTreeSet.template b/src/builder/resources/speiger/assets/collections/templates/sets/AVLTreeSet.template similarity index 99% rename from src/main/resources/speiger/assets/collections/templates/sets/AVLTreeSet.template rename to src/builder/resources/speiger/assets/collections/templates/sets/AVLTreeSet.template index 28ad30a..56ce4a2 100644 --- a/src/main/resources/speiger/assets/collections/templates/sets/AVLTreeSet.template +++ b/src/builder/resources/speiger/assets/collections/templates/sets/AVLTreeSet.template @@ -679,6 +679,9 @@ public class AVL_TREE_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_TYPE @Override public COMPARATOR KEY_GENERIC_TYPE comparator() { return set.comparator(); } + @Override + public abstract BI_ITERATOR KEY_GENERIC_TYPE iterator(); + @Override public KEY_TYPE FIRST_KEY() { Entry KEY_GENERIC_TYPE entry = findLowest(); diff --git a/src/main/resources/speiger/assets/collections/templates/sets/AbstractSet.template b/src/builder/resources/speiger/assets/collections/templates/sets/AbstractSet.template similarity index 95% rename from src/main/resources/speiger/assets/collections/templates/sets/AbstractSet.template rename to src/builder/resources/speiger/assets/collections/templates/sets/AbstractSet.template index 51ddda8..e5c271e 100644 --- a/src/main/resources/speiger/assets/collections/templates/sets/AbstractSet.template +++ b/src/builder/resources/speiger/assets/collections/templates/sets/AbstractSet.template @@ -9,6 +9,9 @@ import speiger.src.collections.PACKAGE.collections.ITERATOR; public abstract class ABSTRACT_SET KEY_GENERIC_TYPE extends ABSTRACT_COLLECTION KEY_GENERIC_TYPE implements SET KEY_GENERIC_TYPE { + @Override + public abstract ITERATOR KEY_GENERIC_TYPE iterator(); + @Override public int hashCode() { int hashCode = 1; diff --git a/src/main/resources/speiger/assets/collections/templates/sets/ArraySet.template b/src/builder/resources/speiger/assets/collections/templates/sets/ArraySet.template similarity index 99% rename from src/main/resources/speiger/assets/collections/templates/sets/ArraySet.template rename to src/builder/resources/speiger/assets/collections/templates/sets/ArraySet.template index 82fe2ef..5f2a19a 100644 --- a/src/main/resources/speiger/assets/collections/templates/sets/ArraySet.template +++ b/src/builder/resources/speiger/assets/collections/templates/sets/ArraySet.template @@ -221,7 +221,7 @@ public class ARRAY_SET KEY_GENERIC_TYPE extends ABSTRACT_SET KEY_GENERIC_TYPE im Objects.requireNonNull(filter); boolean modified = false; int j = 0; - for(int i = 0;i