diff --git a/src/builder/java/speiger/src/builder/GlobalVariables.java b/src/builder/java/speiger/src/builder/GlobalVariables.java index 80e14ae3..40e69571 100644 --- a/src/builder/java/speiger/src/builder/GlobalVariables.java +++ b/src/builder/java/speiger/src/builder/GlobalVariables.java @@ -184,6 +184,7 @@ public class GlobalVariables //Abstract Classes addAbstractMapper("ABSTRACT_COLLECTION", "Abstract%sCollection"); + addAbstractMapper("ABSTRACT_PRIORITY_QUEUE", "Abstract%sPriorityQueue"); addAbstractMapper("ABSTRACT_SET", "Abstract%sSet"); addAbstractMapper("ABSTRACT_LIST", "Abstract%sList"); addAbstractBiMapper("ABSTRACT_MAP", "Abstract%sMap", "2"); diff --git a/src/builder/java/speiger/src/builder/PrimitiveCollectionsBuilder.java b/src/builder/java/speiger/src/builder/PrimitiveCollectionsBuilder.java index 59c56762..20d60088 100644 --- a/src/builder/java/speiger/src/builder/PrimitiveCollectionsBuilder.java +++ b/src/builder/java/speiger/src/builder/PrimitiveCollectionsBuilder.java @@ -78,6 +78,7 @@ public class PrimitiveCollectionsBuilder extends TemplateProcessor nameRemapper.put("IArray", "I%sArray"); nameRemapper.put("AbstractMap", "Abstract%sMap"); nameRemapper.put("AbstractCollection", "Abstract%sCollection"); + nameRemapper.put("AbstractPriorityQueue", "Abstract%sPriorityQueue"); nameRemapper.put("AbstractSet", "Abstract%sSet"); nameRemapper.put("AbstractList", "Abstract%sList"); nameRemapper.put("EnumMap", "Enum2%sMap"); diff --git a/src/builder/resources/speiger/assets/collections/templates/queues/AbstractPriorityQueue.template b/src/builder/resources/speiger/assets/collections/templates/queues/AbstractPriorityQueue.template new file mode 100644 index 00000000..3667f7b2 --- /dev/null +++ b/src/builder/resources/speiger/assets/collections/templates/queues/AbstractPriorityQueue.template @@ -0,0 +1,46 @@ +package speiger.src.collections.PACKAGE.queues; + +#if TYPE_OBJECT +import java.util.Objects; +#endif +import java.util.StringJoiner; + +/** + * Helper class that implements all the essential methods for the PriorityQueues + * @Type(T) + */ +public abstract class ABSTRACT_PRIORITY_QUEUE KEY_GENERIC_TYPE implements PRIORITY_QUEUE KEY_GENERIC_TYPE +{ + @Override + public boolean equals(Object obj) { + if(obj instanceof PRIORITY_QUEUE) { + PRIORITY_QUEUE KEY_GENERIC_TYPE queue = (PRIORITY_QUEUE KEY_GENERIC_TYPE)obj; + if(queue.size() != size()) return false; + for(int i = 0,m=size();i