From c9fc963670efdd2c6de15b36fd34868a92f10ce1 Mon Sep 17 00:00:00 2001 From: Speiger Date: Mon, 5 Dec 2022 07:10:53 +0100 Subject: [PATCH] Few changes. -Removed: BooleanSet classes are gone. (Unused anyways) -Removed: Boolean2xMaps are also now gone. (Unused Anyways) -Added: GlobalFlags that are shared across packages. --- Changelog.md | 3 +- ModulSettings.json | 722 ++++++++++++++++-- .../speiger/src/builder/ModulePackage.java | 13 +- .../builder/PrimitiveCollectionsBuilder.java | 3 +- .../src/builder/modules/BaseModule.java | 2 +- .../src/builder/modules/MapModule.java | 12 +- .../src/builder/modules/SetModule.java | 2 +- .../collections/templates/lists/List.template | 2 +- .../templates/utils/AsyncBuilder.template | 5 +- .../templates/utils/Collections.template | 47 ++ .../templates/utils/Iterators.template | 1 + .../templates/utils/maps/Maps.template | 5 +- 12 files changed, 729 insertions(+), 88 deletions(-) diff --git a/Changelog.md b/Changelog.md index 8e0630ed..3659f18a 100644 --- a/Changelog.md +++ b/Changelog.md @@ -6,7 +6,8 @@ - Added: ToArray function into Iterable which uses ISizeProvider to reduce overhead of duplicating arrays. - Fixed: putIfAbsent now replaces defaultValues - Fixed: OpenHashSet/Map and their Custom Variants no longer rely on List implementations. -- Fixed: ObjectCopyOnWriteList.of did create a ObjectArrayList instead of the CopyOnWrite variant. +- Fixed: ObjectCopyOnWriteList.of did create a ObjectArrayList instead of the CopyOnWrite variant. +- Removed: BooleanSet and Maps that start with a Boolean classes since they can not be used anyways. ### Version 0.7.0 - Added: Over 11 Million Unit Tests to this library to ensure quality. diff --git a/ModulSettings.json b/ModulSettings.json index ebc5a6a3..5d84a687 100644 --- a/ModulSettings.json +++ b/ModulSettings.json @@ -3,7 +3,7 @@ "Base": true, "Collection": true, "Function": true, - "List": false, + "List": true, "Map": true, "Pair": true, "PriorityQueue": true, @@ -126,7 +126,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -138,7 +146,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -150,7 +166,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -162,7 +186,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -174,7 +206,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -186,7 +226,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -198,7 +246,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -210,7 +266,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -222,7 +286,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -260,7 +332,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -272,7 +352,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -284,7 +372,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -296,7 +392,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -308,7 +412,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -320,7 +432,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -332,7 +452,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -344,7 +472,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -356,7 +492,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -394,7 +538,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -406,7 +558,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -418,7 +578,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -430,7 +598,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -442,7 +618,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -454,7 +638,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -466,7 +658,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -478,7 +678,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -490,7 +698,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -528,7 +744,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -540,7 +764,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -552,7 +784,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -564,7 +804,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -576,7 +824,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -588,7 +844,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -600,7 +864,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -612,7 +884,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -624,7 +904,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -662,7 +950,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -674,7 +970,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -686,7 +990,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -698,7 +1010,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -710,7 +1030,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -722,7 +1050,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -734,7 +1070,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -746,7 +1090,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -758,7 +1110,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -796,7 +1156,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -808,7 +1176,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -820,7 +1196,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -832,7 +1216,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -844,7 +1236,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -856,7 +1256,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -868,7 +1276,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -880,7 +1296,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -892,7 +1316,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -930,7 +1362,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -942,7 +1382,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -954,7 +1402,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -966,7 +1422,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -978,7 +1442,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -990,7 +1462,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -1002,7 +1482,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -1014,7 +1502,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -1026,7 +1522,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -1064,7 +1568,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -1076,7 +1588,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -1088,7 +1608,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -1100,7 +1628,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -1112,7 +1648,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -1124,7 +1668,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -1136,7 +1688,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -1148,7 +1708,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true @@ -1160,7 +1728,15 @@ "enabled": true }, "Map": { - "enabled": true + "enabled": true, + "HashMap": true, + "RBTreeMap": true, + "ConcurrentMap": true, + "ArrayMap": true, + "AVLTreeMap": true, + "CustomHashMap": true, + "EnumMap": true, + "ImmutableMap": true }, "Pair": { "enabled": true diff --git a/src/builder/java/speiger/src/builder/ModulePackage.java b/src/builder/java/speiger/src/builder/ModulePackage.java index e7c4b5bb..84933cdc 100644 --- a/src/builder/java/speiger/src/builder/ModulePackage.java +++ b/src/builder/java/speiger/src/builder/ModulePackage.java @@ -31,9 +31,11 @@ public class ModulePackage List> blockedFilters = new ArrayList<>(); List mappers = new ArrayList<>(); Set flags = new LinkedHashSet<>(); + Set globalFlags; BiConsumer requirements = VOID; - public ModulePackage(ClassType keyType, ClassType valueType) { + public ModulePackage(Set globalFlags, ClassType keyType, ClassType valueType) { + this.globalFlags = globalFlags; this.keyType = keyType; this.valueType = valueType; } @@ -68,6 +70,10 @@ public class ModulePackage flags.add(flag); } + public void addGlobalFlag(String flag) { + globalFlags.add(flag); + } + public void addRequirement(String fileName, RequiredType type) { requirements.accept(fileName, type); } @@ -99,6 +105,7 @@ public class ModulePackage TemplateProcess process = new TemplateProcess(newName+".java"); process.setPathBuilder(new PathBuilder(keyType.getPathType())); process.addFlags(flags); + process.addFlags(globalFlags); process.addMappers(mappers); result.accept(process); } @@ -111,11 +118,11 @@ public class ModulePackage return false; } - public static List createPackages() { + public static List createPackages(Set globalFlags) { List list = new ArrayList<>(); for(ClassType key : TYPE) { for(ClassType value : TYPE) { - list.add(new ModulePackage(key, value)); + list.add(new ModulePackage(globalFlags, key, value)); } } return list; diff --git a/src/builder/java/speiger/src/builder/PrimitiveCollectionsBuilder.java b/src/builder/java/speiger/src/builder/PrimitiveCollectionsBuilder.java index 04a7dba2..e495c6fa 100644 --- a/src/builder/java/speiger/src/builder/PrimitiveCollectionsBuilder.java +++ b/src/builder/java/speiger/src/builder/PrimitiveCollectionsBuilder.java @@ -37,6 +37,7 @@ public class PrimitiveCollectionsBuilder extends TemplateProcessor private static final int LOAD = 0x2; //If Configs should be loaded private static final int ANTI_SAVE = SPECIAL | LOAD; //If save should be disabled since load/save shouldn't happen at the same time. private static final int SAVE = 0x4; //if the configuration should be created + Set globalFlags = new HashSet<>(); List simplePackages = new ArrayList<>(); List biPackages = new ArrayList<>(); List enumPackages = new ArrayList<>(); @@ -154,7 +155,7 @@ public class PrimitiveCollectionsBuilder extends TemplateProcessor private void prepPackages() { if((flags & LOAD) != 0) manager.load(); - for(ModulePackage entry : ModulePackage.createPackages()) + for(ModulePackage entry : ModulePackage.createPackages(globalFlags)) { entry.setRequirements(requirements::put); biPackages.add(entry); diff --git a/src/builder/java/speiger/src/builder/modules/BaseModule.java b/src/builder/java/speiger/src/builder/modules/BaseModule.java index 8aadcab1..bc953342 100644 --- a/src/builder/java/speiger/src/builder/modules/BaseModule.java +++ b/src/builder/java/speiger/src/builder/modules/BaseModule.java @@ -73,7 +73,7 @@ public abstract class BaseModule protected void addKeyFlag(String name) { entry.addFlag(name); - entry.addFlag(keyType.getCapType()+"_"+name); + entry.addGlobalFlag(keyType.getCapType()+"_"+name); } protected void addBiRequirement(String fileName) { diff --git a/src/builder/java/speiger/src/builder/modules/MapModule.java b/src/builder/java/speiger/src/builder/modules/MapModule.java index e57124fb..ce60b205 100644 --- a/src/builder/java/speiger/src/builder/modules/MapModule.java +++ b/src/builder/java/speiger/src/builder/modules/MapModule.java @@ -1,5 +1,9 @@ package speiger.src.builder.modules; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + import speiger.src.builder.ClassType; @SuppressWarnings("javadoc") @@ -16,6 +20,12 @@ public class MapModule extends BaseModule @Override public boolean isModuleValid(ClassType keyType, ClassType valueType) { return keyType != ClassType.BOOLEAN; } + @Override + public Set getModuleKeys(ClassType keyType, ClassType valueType) + { + return new HashSet<>(Arrays.asList("ConcurrentMap", "HashMap", "CustomHashMap", "ImmutableMap", "ArrayMap", "EnumMap", "AVLTreeMap", "RBTreeMap")); + } + @Override protected void loadBlockades() { @@ -25,7 +35,7 @@ public class MapModule extends BaseModule addBlockedFiles("SortedMap", "NavigableMap", "RBTreeMap", "AVLTreeMap"); addBlockedFiles("OrderedMap", "ArrayMap", "LinkedOpenHashMap", "LinkedOpenCustomHashMap"); addBlockedFiles("ConcurrentMap", "ConcurrentOpenHashMap"); - addBlockedFiles("ImmutableOpenHashMap", "OpenHashMap", "OpenCustomHashMap"); + addBlockedFiles("Map", "Maps", "AbstractMap", "ImmutableOpenHashMap", "OpenHashMap", "OpenCustomHashMap"); //Test Classes addBlockedFiles("TestMap", "MapTests", "MapTestSuiteBuilder", "MapConstructorTests", "TestMapGenerator", "SimpleMapTestGenerator", "DerivedMapGenerators", "AbstractMapTester"); diff --git a/src/builder/java/speiger/src/builder/modules/SetModule.java b/src/builder/java/speiger/src/builder/modules/SetModule.java index 5ef11bc3..b5723d60 100644 --- a/src/builder/java/speiger/src/builder/modules/SetModule.java +++ b/src/builder/java/speiger/src/builder/modules/SetModule.java @@ -20,7 +20,7 @@ public class SetModule extends BaseModule //Main Classes addBlockedFiles("SortedSet", "NavigableSet", "AVLTreeSet", "RBTreeSet"); addBlockedFiles("OrderedSet", "ArraySet", "LinkedOpenHashSet", "LinkedOpenCustomHashSet"); - addBlockedFiles("OpenHashSet", "OpenCustomHashSet", "ImmutableOpenHashSet"); + addBlockedFiles("Set", "Sets", "AbstractSet", "OpenHashSet", "OpenCustomHashSet", "ImmutableOpenHashSet"); //Test Classes addBlockedFiles("SetTests", "SetTestSuiteBuilder"); diff --git a/src/builder/resources/speiger/assets/collections/templates/lists/List.template b/src/builder/resources/speiger/assets/collections/templates/lists/List.template index 6488ca27..4b821369 100644 --- a/src/builder/resources/speiger/assets/collections/templates/lists/List.template +++ b/src/builder/resources/speiger/assets/collections/templates/lists/List.template @@ -20,7 +20,7 @@ import speiger.src.collections.PACKAGE.collections.SPLIT_ITERATOR; import speiger.src.collections.PACKAGE.functions.COMPARATOR; #endif import speiger.src.collections.PACKAGE.utils.ARRAYS; -#if LIST_FEATURE +#if LISTS_FEATURE import speiger.src.collections.PACKAGE.utils.LISTS; #endif import speiger.src.collections.PACKAGE.utils.SPLIT_ITERATORS; 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 e2d8c211..ce3d73af 100644 --- a/src/builder/resources/speiger/assets/collections/templates/utils/AsyncBuilder.template +++ b/src/builder/resources/speiger/assets/collections/templates/utils/AsyncBuilder.template @@ -28,16 +28,17 @@ import speiger.src.collections.PACKAGE.functions.function.TO_OBJECT_FUNCTION; #endif import speiger.src.collections.PACKAGE.functions.function.UNARY_OPERATOR; #if OBJECT_ASYNC_MODULE +import speiger.src.collections.PACKAGE.lists.LIST; +#endif #if ARRAY_LIST_FEATURE import speiger.src.collections.PACKAGE.lists.ARRAY_LIST; #else if LINKED_LIST_FEATURE import speiger.src.collections.PACKAGE.lists.LINKED_LIST; #endif -#if !TYPE_BOOLEAN +#if !TYPE_BOOLEAN && OBJECT_ASYNC_MODULE import speiger.src.collections.PACKAGE.sets.SET; import speiger.src.collections.PACKAGE.sets.LINKED_HASH_SET; #endif -#endif #if !TYPE_BOOLEAN && BOOLEAN_ASYNC_MODULE import speiger.src.collections.booleans.utils.BooleanAsyncBuilder; import speiger.src.collections.booleans.utils.BooleanAsyncBuilder.BaseBooleanTask; diff --git a/src/builder/resources/speiger/assets/collections/templates/utils/Collections.template b/src/builder/resources/speiger/assets/collections/templates/utils/Collections.template index 58136b18..43122c0a 100644 --- a/src/builder/resources/speiger/assets/collections/templates/utils/Collections.template +++ b/src/builder/resources/speiger/assets/collections/templates/utils/Collections.template @@ -2,6 +2,7 @@ package speiger.src.collections.PACKAGE.utils; import java.util.Arrays; import java.util.Collection; +import java.util.NoSuchElementException; import java.util.Objects; #if TYPE_OBJECT import java.util.Comparator; @@ -84,6 +85,16 @@ public class COLLECTIONS return c instanceof SynchronizedCollection ? c : new SynchronizedCollectionBRACES(c, mutex); } + /** + * Creates a Singleton Collection of a given element + * @param element the element that should be converted into a singleton collection + * @Type(T) + * @return a singletoncollection of the given element + */ + public static GENERIC_KEY_BRACES COLLECTION KEY_GENERIC_TYPE singleton(KEY_TYPE element) { + return new SingletonCollectionBRACES(element); + } + protected static GENERIC_KEY_BRACES CollectionWrapper KEY_GENERIC_TYPE wrapper() { return new CollectionWrapperBRACES(); } @@ -278,6 +289,42 @@ public class COLLECTIONS #endif } + private static class SingletonCollection KEY_GENERIC_TYPE extends ABSTRACT_COLLECTION KEY_GENERIC_TYPE + { + KEY_TYPE element; + + SingletonCollection(KEY_TYPE element) { + this.element = element; + } + +#if !TYPE_OBJECT + @Override + public boolean REMOVE_KEY(KEY_TYPE o) { throw new UnsupportedOperationException(); } +#endif + @Override + public boolean add(KEY_TYPE o) { throw new UnsupportedOperationException(); } + @Override + public ITERATOR KEY_GENERIC_TYPE iterator() + { + return new ITERATOR KEY_GENERIC_TYPE() { + boolean next = true; + @Override + public boolean hasNext() { return next; } + @Override + public KEY_TYPE NEXT() { + if(!hasNext()) throw new NoSuchElementException(); + next = false; + return element; + } + }; + } + @Override + public int size() { return 1; } + + @Override + public SingletonCollection KEY_GENERIC_TYPE copy() { return new SingletonCollectionBRACES(element); } + } + /** * Synchronized Collection Wrapper for the synchronizedCollection function * @Type(T) diff --git a/src/builder/resources/speiger/assets/collections/templates/utils/Iterators.template b/src/builder/resources/speiger/assets/collections/templates/utils/Iterators.template index dad3089f..cd947132 100644 --- a/src/builder/resources/speiger/assets/collections/templates/utils/Iterators.template +++ b/src/builder/resources/speiger/assets/collections/templates/utils/Iterators.template @@ -22,6 +22,7 @@ import speiger.src.collections.PACKAGE.lists.ARRAY_LIST; #else if LINKED_LIST_FEATURE import speiger.src.collections.PACKAGE.lists.LINKED_LIST; #endif +import speiger.src.collections.PACKAGE.lists.LIST; #endif import speiger.src.collections.PACKAGE.lists.LIST_ITERATOR; import speiger.src.collections.PACKAGE.collections.BI_ITERATOR; diff --git a/src/builder/resources/speiger/assets/collections/templates/utils/maps/Maps.template b/src/builder/resources/speiger/assets/collections/templates/utils/maps/Maps.template index efa8f5a5..3b7eb3ff 100644 --- a/src/builder/resources/speiger/assets/collections/templates/utils/maps/Maps.template +++ b/src/builder/resources/speiger/assets/collections/templates/utils/maps/Maps.template @@ -49,9 +49,6 @@ import speiger.src.collections.VALUE_PACKAGE.functions.function.VALUE_UNARY_OPER #endif import speiger.src.collections.VALUE_PACKAGE.functions.VALUE_SUPPLIER; import speiger.src.collections.VALUE_PACKAGE.utils.VALUE_COLLECTIONS; -#if !SAME_TYPE && !VALUE_OBJECT -import speiger.src.collections.VALUE_PACKAGE.utils.VALUE_SETS; -#endif #endif /** @@ -344,7 +341,7 @@ public class MAPS @Override public VALUE_COLLECTION VALUE_GENERIC_TYPE values() { - if(values == null) values = VALUE_SETS.singleton(value); + if(values == null) values = VALUE_COLLECTIONS.singleton(value); return values; } @Override