From 3ce52668df6c4a66e13dcd2431c6601fa97f6828 Mon Sep 17 00:00:00 2001 From: Speiger Date: Wed, 7 Dec 2022 05:30:23 +0100 Subject: [PATCH] Added Priority Queue Module --- ModulSettings.json | 412 ++++++++++-------- .../src/builder/modules/CollectionModule.java | 3 +- .../src/builder/modules/PrioQueueModule.java | 43 +- .../templates/collections/Iterable.template | 2 +- .../templates/lists/LinkedList.template | 53 ++- .../templates/queues/PriorityDequeue.template | 4 + .../templates/queues/PriorityQueue.template | 8 +- .../templates/utils/AsyncBuilder.template | 2 +- .../templates/utils/PriorityQueues.template | 6 + 9 files changed, 323 insertions(+), 210 deletions(-) diff --git a/ModulSettings.json b/ModulSettings.json index 75ee3d3b..bcffe153 100644 --- a/ModulSettings.json +++ b/ModulSettings.json @@ -20,7 +20,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -31,7 +31,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -42,7 +42,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -53,7 +53,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -64,7 +64,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -75,7 +75,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -86,7 +86,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -97,7 +97,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -108,7 +108,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -116,14 +116,20 @@ "Enabled": true }, "PriorityQueue": { - "Enabled": true + "Enabled": true, + "ArrayPrioQueue": true, + "Dequeue": true, + "FiFoQueue": true, + "HeapQueue": true, + "Implementations": false, + "Wrappers": true }, "List": { "Enabled": true, "ArrayList": true, "CopyOnWriteList": true, "ImmutableList": true, - "Implementations": true, + "Implementations": false, "LinkedList": true, "Wrappers": true }, @@ -150,7 +156,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -161,7 +167,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -179,7 +185,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -190,7 +196,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -208,7 +214,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -219,7 +225,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -237,7 +243,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -248,7 +254,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -266,7 +272,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -277,7 +283,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -295,7 +301,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -306,7 +312,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -324,7 +330,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -335,7 +341,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -353,7 +359,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -364,7 +370,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -382,7 +388,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -393,7 +399,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -401,14 +407,20 @@ "Enabled": true }, "PriorityQueue": { - "Enabled": true + "Enabled": true, + "ArrayPrioQueue": true, + "Dequeue": true, + "FiFoQueue": true, + "HeapQueue": true, + "Implementations": false, + "Wrappers": true }, "List": { "Enabled": true, "ArrayList": true, "CopyOnWriteList": true, "ImmutableList": true, - "Implementations": true, + "Implementations": false, "LinkedList": true, "Wrappers": true }, @@ -419,7 +431,7 @@ "CustomHashSet": true, "HashSet": true, "ImmutableSet": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashSet": true, "LinkedHashSet": true, "OrderedSet": true, @@ -450,7 +462,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -461,7 +473,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -479,7 +491,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -490,7 +502,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -508,7 +520,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -519,7 +531,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -537,7 +549,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -548,7 +560,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -566,7 +578,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -577,7 +589,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -595,7 +607,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -606,7 +618,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -624,7 +636,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -635,7 +647,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -653,7 +665,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -664,7 +676,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -682,7 +694,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -693,7 +705,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -701,14 +713,20 @@ "Enabled": true }, "PriorityQueue": { - "Enabled": true + "Enabled": true, + "ArrayPrioQueue": true, + "Dequeue": true, + "FiFoQueue": true, + "HeapQueue": true, + "Implementations": false, + "Wrappers": true }, "List": { "Enabled": true, "ArrayList": true, "CopyOnWriteList": true, "ImmutableList": true, - "Implementations": true, + "Implementations": false, "LinkedList": true, "Wrappers": true }, @@ -719,7 +737,7 @@ "CustomHashSet": true, "HashSet": true, "ImmutableSet": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashSet": true, "LinkedHashSet": true, "OrderedSet": true, @@ -750,7 +768,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -761,7 +779,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -779,7 +797,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -790,7 +808,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -808,7 +826,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -819,7 +837,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -837,7 +855,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -848,7 +866,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -866,7 +884,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -877,7 +895,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -895,7 +913,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -906,7 +924,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -924,7 +942,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -935,7 +953,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -953,7 +971,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -964,7 +982,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -982,7 +1000,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -993,7 +1011,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -1001,14 +1019,20 @@ "Enabled": true }, "PriorityQueue": { - "Enabled": true + "Enabled": true, + "ArrayPrioQueue": true, + "Dequeue": true, + "FiFoQueue": true, + "HeapQueue": true, + "Implementations": false, + "Wrappers": true }, "List": { "Enabled": true, "ArrayList": true, "CopyOnWriteList": true, "ImmutableList": true, - "Implementations": true, + "Implementations": false, "LinkedList": true, "Wrappers": true }, @@ -1019,7 +1043,7 @@ "CustomHashSet": true, "HashSet": true, "ImmutableSet": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashSet": true, "LinkedHashSet": true, "OrderedSet": true, @@ -1050,7 +1074,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -1061,7 +1085,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -1079,7 +1103,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -1090,7 +1114,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -1108,7 +1132,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -1119,7 +1143,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -1137,7 +1161,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -1148,7 +1172,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -1166,7 +1190,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -1177,7 +1201,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -1195,7 +1219,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -1206,7 +1230,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -1224,7 +1248,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -1235,7 +1259,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -1253,7 +1277,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -1264,7 +1288,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -1282,7 +1306,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -1293,7 +1317,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -1301,14 +1325,20 @@ "Enabled": true }, "PriorityQueue": { - "Enabled": true + "Enabled": true, + "ArrayPrioQueue": true, + "Dequeue": true, + "FiFoQueue": true, + "HeapQueue": true, + "Implementations": false, + "Wrappers": true }, "List": { "Enabled": true, "ArrayList": true, "CopyOnWriteList": true, "ImmutableList": true, - "Implementations": true, + "Implementations": false, "LinkedList": true, "Wrappers": true }, @@ -1319,7 +1349,7 @@ "CustomHashSet": true, "HashSet": true, "ImmutableSet": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashSet": true, "LinkedHashSet": true, "OrderedSet": true, @@ -1350,7 +1380,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -1361,7 +1391,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -1379,7 +1409,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -1390,7 +1420,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -1408,7 +1438,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -1419,7 +1449,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -1437,7 +1467,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -1448,7 +1478,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -1466,7 +1496,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -1477,7 +1507,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -1495,7 +1525,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -1506,7 +1536,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -1524,7 +1554,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -1535,7 +1565,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -1553,7 +1583,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -1564,7 +1594,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -1582,7 +1612,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -1593,7 +1623,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -1601,14 +1631,20 @@ "Enabled": true }, "PriorityQueue": { - "Enabled": true + "Enabled": true, + "ArrayPrioQueue": true, + "Dequeue": true, + "FiFoQueue": true, + "HeapQueue": true, + "Implementations": false, + "Wrappers": true }, "List": { "Enabled": true, "ArrayList": true, "CopyOnWriteList": true, "ImmutableList": true, - "Implementations": true, + "Implementations": false, "LinkedList": true, "Wrappers": true }, @@ -1619,7 +1655,7 @@ "CustomHashSet": true, "HashSet": true, "ImmutableSet": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashSet": true, "LinkedHashSet": true, "OrderedSet": true, @@ -1650,7 +1686,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -1661,7 +1697,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -1679,7 +1715,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -1690,7 +1726,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -1708,7 +1744,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -1719,7 +1755,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -1737,7 +1773,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -1748,7 +1784,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -1766,7 +1802,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -1777,7 +1813,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -1795,7 +1831,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -1806,7 +1842,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -1824,7 +1860,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -1835,7 +1871,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -1853,7 +1889,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -1864,7 +1900,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -1882,7 +1918,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -1893,7 +1929,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -1901,14 +1937,20 @@ "Enabled": true }, "PriorityQueue": { - "Enabled": true + "Enabled": true, + "ArrayPrioQueue": true, + "Dequeue": true, + "FiFoQueue": true, + "HeapQueue": true, + "Implementations": false, + "Wrappers": true }, "List": { "Enabled": true, "ArrayList": true, "CopyOnWriteList": true, "ImmutableList": true, - "Implementations": true, + "Implementations": false, "LinkedList": true, "Wrappers": true }, @@ -1919,7 +1961,7 @@ "CustomHashSet": true, "HashSet": true, "ImmutableSet": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashSet": true, "LinkedHashSet": true, "OrderedSet": true, @@ -1950,7 +1992,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -1961,7 +2003,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -1979,7 +2021,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -1990,7 +2032,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -2008,7 +2050,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -2019,7 +2061,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -2037,7 +2079,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -2048,7 +2090,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -2066,7 +2108,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -2077,7 +2119,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -2095,7 +2137,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -2106,7 +2148,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -2124,7 +2166,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -2135,7 +2177,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -2153,7 +2195,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -2164,7 +2206,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -2182,7 +2224,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -2193,7 +2235,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -2201,14 +2243,20 @@ "Enabled": true }, "PriorityQueue": { - "Enabled": true + "Enabled": true, + "ArrayPrioQueue": true, + "Dequeue": true, + "FiFoQueue": true, + "HeapQueue": true, + "Implementations": false, + "Wrappers": true }, "List": { "Enabled": true, "ArrayList": true, "CopyOnWriteList": true, "ImmutableList": true, - "Implementations": true, + "Implementations": false, "LinkedList": true, "Wrappers": true }, @@ -2219,7 +2267,7 @@ "CustomHashSet": true, "HashSet": true, "ImmutableSet": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashSet": true, "LinkedHashSet": true, "OrderedSet": true, @@ -2250,7 +2298,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -2261,7 +2309,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -2279,7 +2327,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -2290,7 +2338,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -2308,7 +2356,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -2319,7 +2367,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -2337,7 +2385,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -2348,7 +2396,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -2366,7 +2414,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -2377,7 +2425,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -2395,7 +2443,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -2406,7 +2454,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -2424,7 +2472,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -2435,7 +2483,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -2453,7 +2501,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -2464,7 +2512,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -2482,7 +2530,7 @@ "EnumMap": true, "HashMap": true, "ImmutableMap": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashMap": true, "LinkedEnumMap": true, "LinkedHashMap": true, @@ -2493,7 +2541,7 @@ }, "Pair": { "Enabled": true, - "Immutable": false, + "Immutable": true, "Mutable": true } }, @@ -2501,14 +2549,20 @@ "Enabled": true }, "PriorityQueue": { - "Enabled": true + "Enabled": true, + "ArrayPrioQueue": true, + "Dequeue": true, + "FiFoQueue": true, + "HeapQueue": true, + "Implementations": false, + "Wrappers": true }, "List": { "Enabled": true, "ArrayList": true, "CopyOnWriteList": true, "ImmutableList": true, - "Implementations": true, + "Implementations": false, "LinkedList": true, "Wrappers": true }, @@ -2519,7 +2573,7 @@ "CustomHashSet": true, "HashSet": true, "ImmutableSet": true, - "Implementations": true, + "Implementations": false, "LinkedCustomHashSet": true, "LinkedHashSet": true, "OrderedSet": true, diff --git a/src/builder/java/speiger/src/builder/modules/CollectionModule.java b/src/builder/java/speiger/src/builder/modules/CollectionModule.java index 3dcfb8ac..a2c9afae 100644 --- a/src/builder/java/speiger/src/builder/modules/CollectionModule.java +++ b/src/builder/java/speiger/src/builder/modules/CollectionModule.java @@ -75,7 +75,8 @@ public class CollectionModule extends BaseModule addClassMapper("LIST_ITERATOR", "ListIterator"); addClassMapper("BI_ITERATOR", "BidirectionalIterator"); addClassMapper("ITERATOR", "Iterator"); - addClassMapper("STACK", "Stack"); + if(keyType.isObject()) addSimpleMapper("STACK", "Stack"); + else addClassMapper("STACK", "Stack"); addClassMapper("STRATEGY", "Strategy"); } diff --git a/src/builder/java/speiger/src/builder/modules/PrioQueueModule.java b/src/builder/java/speiger/src/builder/modules/PrioQueueModule.java index 2179af92..d8cba687 100644 --- a/src/builder/java/speiger/src/builder/modules/PrioQueueModule.java +++ b/src/builder/java/speiger/src/builder/modules/PrioQueueModule.java @@ -1,5 +1,9 @@ package speiger.src.builder.modules; +import java.util.Arrays; +import java.util.Set; +import java.util.TreeSet; + import speiger.src.builder.ClassType; @SuppressWarnings("javadoc") @@ -12,22 +16,46 @@ public class PrioQueueModule extends BaseModule @Override protected void loadVariables() {} @Override - protected void loadFlags() {} - @Override protected void loadFunctions() {} @Override public boolean areDependenciesLoaded() { return isDependencyLoaded(CollectionModule.INSTANCE); } + @Override - protected void loadBlockades() - { + public Set getModuleKeys(ClassType keyType, ClassType valueType) { + return new TreeSet<>(Arrays.asList("Wrappers", "Implementations", "Dequeue", "FiFoQueue", "HeapQueue", "ArrayPrioQueue")); + } + + @Override + protected void loadFlags() { + if(isModuleEnabled()) addFlag("QUEUE_MODULE"); + if(isModuleEnabled("Wrappers")) addKeyFlag("QUEUES_FEATURE"); + boolean implementations = isModuleEnabled("Implementations"); + if(isModuleEnabled("Dequeue")) { + addKeyFlag("DEQUEUE_FEATURE"); + if(implementations && isModuleEnabled("FiFoQueue")) addKeyFlag("FIFO_QUEUE_FEATURE"); + } + if(implementations && isModuleEnabled("HeapQueue")) addKeyFlag("HEAP_QUEUE_FEATURE"); + if(implementations && isModuleEnabled("ArrayPrioQueue")) addKeyFlag("ARRAY_QUEUE_FEATURE"); + } + + @Override + protected void loadBlockades() { + if(!isModuleEnabled()) addBlockedFiles("PriorityQueue", "AbstractPriorityQueue"); + if(!isModuleEnabled("Wrappers")) addBlockedFiles("PriorityQueues"); + boolean implementations = !isModuleEnabled("Implementations"); + boolean dequeue = !isModuleEnabled("Dequeue"); + if(dequeue) addBlockedFiles("PriorityDequeue"); + if(dequeue || implementations || !isModuleEnabled("FiFoQueue")) addBlockedFiles("ArrayFIFOQueue"); + if(implementations || !isModuleEnabled("HeapQueue")) addBlockedFiles("HeapPriorityQueue"); + if(implementations || !isModuleEnabled("ArrayPrioQueue")) addBlockedFiles("ArrayPriorityQueue"); + if(keyType == ClassType.BOOLEAN) { addBlockedFiles("QueueTests"); } } @Override - protected void loadRemappers() - { + protected void loadRemappers() { //Main Classes addRemapper("AbstractPriorityQueue", "Abstract%sPriorityQueue"); @@ -38,8 +66,7 @@ public class PrioQueueModule extends BaseModule } @Override - protected void loadClasses() - { + protected void loadClasses() { //Implementation Classes addClassMapper("ARRAY_FIFO_QUEUE", "ArrayFIFOQueue"); addClassMapper("ARRAY_PRIORITY_QUEUE", "ArrayPriorityQueue"); diff --git a/src/builder/resources/speiger/assets/collections/templates/collections/Iterable.template b/src/builder/resources/speiger/assets/collections/templates/collections/Iterable.template index 631850e5..fbfee5db 100644 --- a/src/builder/resources/speiger/assets/collections/templates/collections/Iterable.template +++ b/src/builder/resources/speiger/assets/collections/templates/collections/Iterable.template @@ -26,8 +26,8 @@ import speiger.src.collections.PACKAGE.lists.LINKED_LIST; #endif #endif #if SET_MODULE && !TYPE_BOOLEAN -import speiger.src.collections.PACKAGE.sets.SET; #if LINKED_SET_FEATURE || LINKED_CUSTOM_SET_FEATURE || SET_FEATURE || CUSTOM_SET_FEATURE || RB_TREE_SET_FEATURE || AVL_TREE_SET_FEATURE || ARRAY_SET_FEATURE +import speiger.src.collections.PACKAGE.sets.SET; #if LINKED_SET_FEATURE import speiger.src.collections.PACKAGE.sets.LINKED_HASH_SET; #else if LINKED_CUSTOM_SET_FEATURE diff --git a/src/builder/resources/speiger/assets/collections/templates/lists/LinkedList.template b/src/builder/resources/speiger/assets/collections/templates/lists/LinkedList.template index 2320766c..89fd2d58 100644 --- a/src/builder/resources/speiger/assets/collections/templates/lists/LinkedList.template +++ b/src/builder/resources/speiger/assets/collections/templates/lists/LinkedList.template @@ -1,7 +1,9 @@ package speiger.src.collections.PACKAGE.lists; #if TYPE_OBJECT +#if DEQUEUE_FEATURE import java.util.Comparator; +#endif import java.util.function.BiFunction; #else if PRIMITIVES import java.nio.JAVA_BUFFER; @@ -31,9 +33,13 @@ import speiger.src.collections.PACKAGE.collections.STACK; import speiger.src.collections.ints.functions.function.Int2ObjectFunction; #endif import speiger.src.collections.PACKAGE.collections.ITERATOR; +#if DEQUEUE_FEATURE import speiger.src.collections.PACKAGE.queues.PRIORITY_DEQUEUE; +#endif #if !TYPE_OBJECT +#if DEQUEUE_FEATURE import speiger.src.collections.PACKAGE.functions.COMPARATOR; +#endif import speiger.src.collections.PACKAGE.functions.CONSUMER; #endif import speiger.src.collections.PACKAGE.utils.ARRAYS; @@ -62,10 +68,10 @@ import speiger.src.collections.utils.SanityChecks; * * @Type(T) */ -#if TYPE_OBJECT -public class LINKED_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE implements PRIORITY_DEQUEUE KEY_GENERIC_TYPE, Stack KEY_GENERIC_TYPE -#else +#if DEQUEUE_FEATURE public class LINKED_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE implements PRIORITY_DEQUEUE KEY_GENERIC_TYPE, STACK KEY_GENERIC_TYPE +#else +public class LINKED_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE implements STACK KEY_GENERIC_TYPE #endif { Entry KEY_GENERIC_TYPE first; @@ -222,6 +228,7 @@ public class LINKED_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE return true; } +#if DEQUEUE_FEATURE @Override public void enqueue(KEY_TYPE e) { add(e); @@ -232,6 +239,7 @@ public class LINKED_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE add(0, e); } +#endif @Override public void push(KEY_TYPE e) { add(e); @@ -291,6 +299,7 @@ public class LINKED_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE return a; } +#if DEQUEUE_FEATURE @Override public KEY_TYPE first() { if(first == null) throw new NoSuchElementException(); @@ -303,11 +312,11 @@ public class LINKED_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE return last.value; } +#endif @Override public KEY_TYPE peek(int index) { return GET_KEY((size() - 1) - index); } - @Override public KEY_TYPE GET_KEY(int index) { checkRange(index); @@ -525,6 +534,7 @@ public class LINKED_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE } #endif +#if DEQUEUE_FEATURE @Override public void onChanged() {} @Override @@ -538,25 +548,24 @@ public class LINKED_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE @Override public KEY_TYPE dequeueLast() { + return pop(); + } + +#endif + @Override + public KEY_TYPE pop() { if(last == null) throw new NoSuchElementException(); return unlinkLast(last); } - @Override - public KEY_TYPE pop() { - return dequeueLast(); - } - +#if DEQUEUE_FEATURE @Override public boolean removeFirst(KEY_TYPE e) { - if(size == 0) return false; - for(Entry KEY_GENERIC_TYPE entry = first;entry != null;entry = entry.next) { - if(KEY_EQUALS(entry.value, e)) { - unlink(entry); - return true; - } - } - return false; +#if TYPE_OBJECT + return remove(e); +#else + return REMOVE_KEY(e); +#endif } @Override @@ -571,6 +580,7 @@ public class LINKED_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE return false; } +#endif @Override public KEY_TYPE swapRemove(int index) { checkRange(index); @@ -653,7 +663,14 @@ public class LINKED_LIST KEY_GENERIC_TYPE extends ABSTRACT_LIST KEY_GENERIC_TYPE #else @Override public boolean REMOVE_KEY(KEY_TYPE e) { - return removeFirst(e); + if(size == 0) return false; + for(Entry KEY_GENERIC_TYPE entry = first;entry != null;entry = entry.next) { + if(KEY_EQUALS(entry.value, e)) { + unlink(entry); + return true; + } + } + return false; } #endif diff --git a/src/builder/resources/speiger/assets/collections/templates/queues/PriorityDequeue.template b/src/builder/resources/speiger/assets/collections/templates/queues/PriorityDequeue.template index 9453db9d..510ab8c4 100644 --- a/src/builder/resources/speiger/assets/collections/templates/queues/PriorityDequeue.template +++ b/src/builder/resources/speiger/assets/collections/templates/queues/PriorityDequeue.template @@ -6,7 +6,9 @@ import java.util.Iterator; #endif import speiger.src.collections.PACKAGE.collections.COLLECTION; import speiger.src.collections.PACKAGE.collections.ITERATOR; +#if QUEUES_FEATURE import speiger.src.collections.PACKAGE.utils.PRIORITY_QUEUES; +#endif /** * A Type Speciifc PriorityDeque or Dequeue interface to allow implementations like FIFO queues. @@ -81,6 +83,7 @@ public interface PRIORITY_DEQUEUE KEY_GENERIC_TYPE extends PRIORITY_QUEUE KEY_GE */ public default KEY_TYPE last() { return peek(size()-1); } +#if QUEUES_FEATURE /** * Creates a Wrapped PriorityDequeue that is Synchronized * @return a new PriorityDequeue that is synchronized @@ -96,6 +99,7 @@ public interface PRIORITY_DEQUEUE KEY_GENERIC_TYPE extends PRIORITY_QUEUE KEY_GE */ public default PRIORITY_DEQUEUE KEY_GENERIC_TYPE synchronizeQueue(Object mutex) { return PRIORITY_QUEUES.synchronize(this, mutex); } +#endif @Override public PRIORITY_DEQUEUE KEY_GENERIC_TYPE copy(); } \ No newline at end of file diff --git a/src/builder/resources/speiger/assets/collections/templates/queues/PriorityQueue.template b/src/builder/resources/speiger/assets/collections/templates/queues/PriorityQueue.template index 78ac1ec9..a1712324 100644 --- a/src/builder/resources/speiger/assets/collections/templates/queues/PriorityQueue.template +++ b/src/builder/resources/speiger/assets/collections/templates/queues/PriorityQueue.template @@ -12,7 +12,9 @@ import speiger.src.collections.PACKAGE.functions.COMPARATOR; import speiger.src.collections.PACKAGE.collections.COLLECTION; import speiger.src.collections.PACKAGE.collections.ITERABLE; import speiger.src.collections.PACKAGE.collections.ITERATOR; +#if QUEUES_FEATURE import speiger.src.collections.PACKAGE.utils.PRIORITY_QUEUES; +#endif /** @@ -147,8 +149,9 @@ public interface PRIORITY_QUEUE KEY_GENERIC_TYPE extends ITERABLE KEY_GENERIC_TY * @return draining iterator of the PriorityQueue */ public ITERATOR KEY_GENERIC_TYPE iterator(); + #endif - +#if QUEUES_FEATURE /** * Creates a Wrapped PriorityQueue that is Synchronized * @return a new PriorityQueue that is synchronized @@ -163,7 +166,8 @@ public interface PRIORITY_QUEUE KEY_GENERIC_TYPE extends ITERABLE KEY_GENERIC_TY * @see PRIORITY_QUEUES#synchronize */ public default PRIORITY_QUEUE KEY_GENERIC_TYPE synchronizeQueue(Object mutex) { return PRIORITY_QUEUES.synchronize(this, mutex); } - + +#endif /** * A method to drop the contents of the Queue without clearing the queue * @Type(E) diff --git a/src/builder/resources/speiger/assets/collections/templates/utils/AsyncBuilder.template b/src/builder/resources/speiger/assets/collections/templates/utils/AsyncBuilder.template index 80360178..e9903c07 100644 --- a/src/builder/resources/speiger/assets/collections/templates/utils/AsyncBuilder.template +++ b/src/builder/resources/speiger/assets/collections/templates/utils/AsyncBuilder.template @@ -37,8 +37,8 @@ import speiger.src.collections.PACKAGE.lists.LINKED_LIST; #endif #if !TYPE_BOOLEAN && OBJECT_ASYNC_MODULE #if SET_MODULE -import speiger.src.collections.PACKAGE.sets.SET; #if LINKED_SET_FEATURE || LINKED_CUSTOM_SET_FEATURE || SET_FEATURE || CUSTOM_SET_FEATURE || RB_TREE_SET_FEATURE || AVL_TREE_SET_FEATURE || ARRAY_SET_FEATURE +import speiger.src.collections.PACKAGE.sets.SET; #if LINKED_SET_FEATURE import speiger.src.collections.PACKAGE.sets.LINKED_HASH_SET; #else if LINKED_CUSTOM_SET_FEATURE diff --git a/src/builder/resources/speiger/assets/collections/templates/utils/PriorityQueues.template b/src/builder/resources/speiger/assets/collections/templates/utils/PriorityQueues.template index 61f7d325..03ba1276 100644 --- a/src/builder/resources/speiger/assets/collections/templates/utils/PriorityQueues.template +++ b/src/builder/resources/speiger/assets/collections/templates/utils/PriorityQueues.template @@ -11,7 +11,9 @@ import speiger.src.collections.PACKAGE.collections.COLLECTION; #if !TYPE_OBJECT import speiger.src.collections.PACKAGE.functions.COMPARATOR; #endif +#if DEQUEUE_FEATURE import speiger.src.collections.PACKAGE.queues.PRIORITY_DEQUEUE; +#endif import speiger.src.collections.PACKAGE.queues.PRIORITY_QUEUE; #if !TYPE_OBJECT import speiger.src.collections.PACKAGE.functions.CONSUMER; @@ -46,6 +48,7 @@ public class PRIORITY_QUEUES return queue instanceof SynchronizedPriorityQueue ? (SynchronizedPriorityQueue KEY_GENERIC_TYPE)queue : new SynchronizedPriorityQueueBRACES(queue, mutex); } +#if DEQUEUE_FEATURE /** * Returns a synchronized PriorityDequeue instance based on the instance given. * @param dequeue that should be synchronized @@ -67,6 +70,7 @@ public class PRIORITY_QUEUES return dequeue instanceof SynchronizedPriorityDequeue ? (SynchronizedPriorityDequeue KEY_GENERIC_TYPE)dequeue : new SynchronizedPriorityDequeueBRACES(dequeue, mutex); } +#endif /** * Wrapper class for synchronization * @Type(T) @@ -134,6 +138,7 @@ public class PRIORITY_QUEUES public int count(PREDICATE KEY_GENERIC_TYPE filter) { synchronized(mutex) { return queue.count(filter); } } } +#if DEQUEUE_FEATURE /** * Wrapper class for synchronization * @Type(T) @@ -166,4 +171,5 @@ public class PRIORITY_QUEUES @Override public PRIORITY_DEQUEUE KEY_GENERIC_TYPE copy() { synchronized(mutex) { return dequeue.copy(); } } } +#endif }