Improved Settings a bit.

-Added: "Implementations" configuration to turn of all "Implementations" keeping the interfaces/wrappers/abstract classes. Reducing the amount of configurations that need to be set.
-Changed: removed "Sets/Maps/Lists" configuration and replaced it with "Wrappers" since they are wrappers.
-Changed: Category Specific settings (except "Enabled") is sorted by Name.
This commit is contained in:
Speiger 2022-12-07 04:07:11 +01:00
parent 1b1ec4b87a
commit 8d9f7a6761
7 changed files with 828 additions and 737 deletions

File diff suppressed because it is too large Load Diff

View File

@ -149,11 +149,8 @@ public class PrimitiveCollectionsBuilder extends TemplateProcessor
public void addModules(List<BaseModule> modules)
{
if((flags & LOAD) != 0)
{
for(int i = 0,m=modules.size();i<m;i++) {
modules.get(i).setManager(manager);
}
for(int i = 0,m=modules.size();i<m;i++) {
modules.get(i).setManager(manager);
}
for(int i = 0,m=modules.size();i<m;i++) {
biPackages.forEach(modules.get(i)::init);
@ -256,8 +253,8 @@ public class PrimitiveCollectionsBuilder extends TemplateProcessor
boolean force = flags.contains("force");
boolean tests = flags.contains("tests");
boolean forceTests = flags.contains("force-tests");
boolean load = !flags.contains("load");
boolean save = flags.contains("save");
boolean load = flags.contains("load");
boolean save = !flags.contains("save");
int flag = (load ? LOAD : 0) | (save ? SAVE : 0);
new PrimitiveCollectionsBuilder(silent).setFlags(flag).process(force);
if(tests) {

View File

@ -1,8 +1,8 @@
package speiger.src.builder.modules;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import java.util.TreeSet;
import speiger.src.builder.ClassType;
@ -18,21 +18,23 @@ public class ListModule extends BaseModule
@Override
protected void loadFlags() {
if(isModuleEnabled()) addKeyFlag("LIST_MODULE");
if(isModuleEnabled("Lists")) addKeyFlag("LISTS_FEATURE");
if(isModuleEnabled("ArrayList")) addKeyFlag("ARRAY_LIST_FEATURE");
if(isModuleEnabled("LinkedList")) addKeyFlag("LINKED_LIST_FEATURE");
if(isModuleEnabled("ImmutableList")) addKeyFlag("IMMUTABLE_LIST_FEATURE");
if(isModuleEnabled("CopyOnWriteList")) addKeyFlag("COPY_ON_WRITE_LIST_FEATURE");
if(isModuleEnabled("Wrappers")) addKeyFlag("LISTS_FEATURE");
boolean implementations = isModuleEnabled("Implementations");
if(implementations && isModuleEnabled("ArrayList")) addKeyFlag("ARRAY_LIST_FEATURE");
if(implementations && isModuleEnabled("LinkedList")) addKeyFlag("LINKED_LIST_FEATURE");
if(implementations && isModuleEnabled("ImmutableList")) addKeyFlag("IMMUTABLE_LIST_FEATURE");
if(implementations && isModuleEnabled("CopyOnWriteList")) addKeyFlag("COPY_ON_WRITE_LIST_FEATURE");
}
@Override
protected void loadBlockades()
{
if(!isModuleEnabled("Lists")) addBlockedFiles("Lists");
if(!isModuleEnabled("ArrayList")) addBlockedFiles("ArrayList");
if(!isModuleEnabled("LinkedList")) addBlockedFiles("LinkedList");
if(!isModuleEnabled("ImmutableList")) addBlockedFiles("ImmutableList");
if(!isModuleEnabled("CopyOnWriteList")) addBlockedFiles("CopyOnWriteList");
if(!isModuleEnabled("Wrappers")) addBlockedFiles("Lists");
boolean implementations = !isModuleEnabled("Implementations");
if(implementations || !isModuleEnabled("ArrayList")) addBlockedFiles("ArrayList");
if(implementations || !isModuleEnabled("LinkedList")) addBlockedFiles("LinkedList");
if(implementations || !isModuleEnabled("ImmutableList")) addBlockedFiles("ImmutableList");
if(implementations || !isModuleEnabled("CopyOnWriteList")) addBlockedFiles("CopyOnWriteList");
if(!isModuleEnabled()) addBlockedFiles("List", "AbstractList");
if(keyType.isObject()) addBlockedFiles("ListFillBufferTester");
@ -41,7 +43,7 @@ public class ListModule extends BaseModule
@Override
public Set<String> getModuleKeys(ClassType keyType, ClassType valueType) {
return new HashSet<>(Arrays.asList("Lists", "ArrayList", "LinkedList", "ImmutableList", "CopyOnWriteList"));
return new TreeSet<>(Arrays.asList("Implementations", "Wrappers", "ArrayList", "LinkedList", "ImmutableList", "CopyOnWriteList"));
}
@Override

View File

@ -1,8 +1,8 @@
package speiger.src.builder.modules;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import java.util.TreeSet;
import speiger.src.builder.ClassType;
@ -23,10 +23,9 @@ public class MapModule extends BaseModule
public boolean areDependenciesLoaded() { return isDependencyLoaded(SetModule.INSTANCE) && isDependencyLoaded(CollectionModule.INSTANCE, false); }
@Override
public Set<String> getModuleKeys(ClassType keyType, ClassType valueType)
{
Set<String> sets = new HashSet<>();
sets.add("Maps");
public Set<String> getModuleKeys(ClassType keyType, ClassType valueType) {
Set<String> sets = new TreeSet<>();
sets.addAll(Arrays.asList("Wrappers", "Implementations"));
sets.addAll(Arrays.asList("OrderedMap", "SortedMap"));
sets.addAll(Arrays.asList("ArrayMap", "ConcurrentMap", "ImmutableMap"));
sets.addAll(Arrays.asList("HashMap", "LinkedHashMap"));
@ -40,10 +39,11 @@ public class MapModule extends BaseModule
protected void loadFlags()
{
if(isModuleEnabled()) addFlag("MAP_MODULE");
if(isModuleEnabled("Maps")) addFlag("Maps");
boolean hashMap = isModuleEnabled("HashMap");
boolean customHashMap = isModuleEnabled("CustomHashMap");
boolean enumMap = isModuleEnabled("EnumMap");
if(isModuleEnabled("Wrappers")) addFlag("MAPS_FEATURE");
boolean implementations = isModuleEnabled("Implementations");
boolean hashMap = implementations && isModuleEnabled("HashMap");
boolean customHashMap = implementations && isModuleEnabled("CustomHashMap");
boolean enumMap = implementations && isModuleEnabled("EnumMap");
if(isModuleEnabled("OrderedMap")) {
addFlag("ORDERED_MAP_FEATURE");
@ -54,11 +54,11 @@ public class MapModule extends BaseModule
}
if(isModuleEnabled("SortedMap")) {
addFlag("SORTED_MAP_FEATURE");
if(isModuleEnabled("AVLTreeMap")) addFlag("AVL_TREE_MAP_FEATURE");
if(isModuleEnabled("RBTreeMap")) addFlag("RB_TREE_MAP_FEATURE");
if(implementations && isModuleEnabled("AVLTreeMap")) addFlag("AVL_TREE_MAP_FEATURE");
if(implementations && isModuleEnabled("RBTreeMap")) addFlag("RB_TREE_MAP_FEATURE");
}
if(isModuleEnabled("ConcurrentMap")) addFlag("CONCURRENT_MAP_FEATURE");
if(isModuleEnabled("ImmutableMap")) addFlag("IMMUTABLE_MAP_FEATURE");
if(implementations && isModuleEnabled("ConcurrentMap")) addFlag("CONCURRENT_MAP_FEATURE");
if(implementations && isModuleEnabled("ImmutableMap")) addFlag("IMMUTABLE_MAP_FEATURE");
if(hashMap) addFlag("HASH_MAP_FEATURE");
if(customHashMap) addFlag("CUSTOM_HASH_MAP_FEATURE");
if(enumMap) addFlag("ENUM_MAP_FEATURE");
@ -68,21 +68,22 @@ public class MapModule extends BaseModule
protected void loadBlockades()
{
if(!isModuleEnabled()) addBlockedFiles("Map", "AbstractMap");
if(!isModuleEnabled("Maps")) addBlockedFiles("Maps");
if(!isModuleEnabled("ImmutableMap")) addBlockedFiles("ImmutableOpenHashMap");
if(!isModuleEnabled("ConcurrentMap")) addBlockedFiles("ConcurrentMap", "ConcurrentOpenHashMap");
if(!isModuleEnabled("Wrappers")) addBlockedFiles("Maps");
boolean implementations = !isModuleEnabled("Implementations");
if(implementations || !isModuleEnabled("ImmutableMap")) addBlockedFiles("ImmutableOpenHashMap");
if(implementations || !isModuleEnabled("ConcurrentMap")) addBlockedFiles("ConcurrentMap", "ConcurrentOpenHashMap");
boolean ordered = !isModuleEnabled("OrderedMap");
if(ordered) addBlockedFiles("OrderedMap");
boolean hashMap = !isModuleEnabled("HashMap");
boolean hashMap = implementations || !isModuleEnabled("HashMap");
if(hashMap) addBlockedFiles("OpenHashMap");
if(hashMap || ordered || !isModuleEnabled("LinkedHashMap")) addBlockedFiles("LinkedOpenHashMap");
boolean customHashMap = !isModuleEnabled("CustomHashMap");
boolean customHashMap = implementations || !isModuleEnabled("CustomHashMap");
if(customHashMap) addBlockedFiles("OpenCustomHashMap");
if(customHashMap || ordered || !isModuleEnabled("LinkedCustomHashMap")) addBlockedFiles("LinkedOpenCustomHashMap");
boolean enumMap = !isModuleEnabled("EnumMap");
boolean enumMap = implementations || !isModuleEnabled("EnumMap");
if(enumMap) addBlockedFiles("EnumMap");
if(enumMap || ordered || !isModuleEnabled("LinkedEnumMap")) addBlockedFiles("LinkedEnumMap");
@ -90,8 +91,8 @@ public class MapModule extends BaseModule
boolean sorted = !isModuleEnabled("SortedMap");
if(sorted) addBlockedFiles("SortedMap", "NavigableMap");
if(sorted || !isModuleEnabled("AVLTreeMap")) addBlockedFiles("AVLTreeMap");
if(sorted || !isModuleEnabled("RBTreeMap")) addBlockedFiles("RBTreeMap");
if(implementations || sorted || !isModuleEnabled("AVLTreeMap")) addBlockedFiles("AVLTreeMap");
if(implementations || sorted || !isModuleEnabled("RBTreeMap")) addBlockedFiles("RBTreeMap");
if(keyType == ClassType.BOOLEAN)
{

View File

@ -1,8 +1,8 @@
package speiger.src.builder.modules;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
import java.util.TreeSet;
import speiger.src.builder.ClassType;
@ -22,8 +22,8 @@ public class SetModule extends BaseModule
public boolean areDependenciesLoaded() { return isDependencyLoaded(CollectionModule.INSTANCE); }
@Override
public Set<String> getModuleKeys(ClassType keyType, ClassType valueType) {
Set<String> sets = new HashSet<>();
sets.add("Sets");
Set<String> sets = new TreeSet<>();
sets.addAll(Arrays.asList("Wrappers", "Implementations"));
sets.addAll(Arrays.asList("OrderedSet", "SortedSet"));
sets.addAll(Arrays.asList("ArraySet", "ImmutableSet"));
sets.addAll(Arrays.asList("HashSet", "LinkedHashSet"));
@ -36,22 +36,23 @@ public class SetModule extends BaseModule
protected void loadFlags()
{
if(isModuleEnabled()) addFlag("SET_MODULE");
if(isModuleEnabled("Sets")) addFlag("Sets");
boolean hashSet = isModuleEnabled("HashSet");
boolean customHashSet = isModuleEnabled("CustomHashSet");
if(isModuleEnabled("Wrappers")) addFlag("SETS_FEATURE");
boolean implementations = isModuleEnabled("Implementations");
boolean hashSet = implementations && isModuleEnabled("HashSet");
boolean customHashSet = implementations && isModuleEnabled("CustomHashSet");
if(isModuleEnabled("OrderedSet")) {
addFlag("ORDERED_SET_FEATURE");
if(isModuleEnabled("ArraySet")) addFlag("ARRAY_SET_FEATURE");
if(implementations && isModuleEnabled("ArraySet")) addFlag("ARRAY_SET_FEATURE");
if(hashSet && isModuleEnabled("LinkedHashSet")) addFlag("LINKED_SET_FEATURE");
if(customHashSet && isModuleEnabled("LinkedCustomHashSet")) addFlag("LINKED_CUSTOM_SET_FEATURE");
}
if(isModuleEnabled("SortedSet")) {
addFlag("SORTED_SET_FEATURE");
if(isModuleEnabled("AVLTreeSet")) addFlag("AVL_TREE_SET_FEATURE");
if(isModuleEnabled("RBTreeSet")) addFlag("RB_TREE_SET_FEATURE");
if(implementations && isModuleEnabled("AVLTreeSet")) addFlag("AVL_TREE_SET_FEATURE");
if(implementations && isModuleEnabled("RBTreeSet")) addFlag("RB_TREE_SET_FEATURE");
}
if(isModuleEnabled("ImmutableSet")) addFlag("IMMUTABLE_SET_FEATURE");
if(implementations && isModuleEnabled("ImmutableSet")) addFlag("IMMUTABLE_SET_FEATURE");
if(hashSet) addFlag("HASH_SET_FEATURE");
if(customHashSet) addFlag("CUSTOM_HASH_SET_FEATURE");
}
@ -60,25 +61,26 @@ public class SetModule extends BaseModule
protected void loadBlockades()
{
if(!isModuleEnabled()) addBlockedFiles("Set", "AbstractSet");
if(!isModuleEnabled("Sets")) addBlockedFiles("Sets");
if(!isModuleEnabled("ImmutableSet")) addBlockedFiles("ImmutableOpenHashSet");
if(!isModuleEnabled("Wrappers")) addBlockedFiles("Sets");
boolean implementations = !isModuleEnabled("Implementations");
if(implementations || !isModuleEnabled("ImmutableSet")) addBlockedFiles("ImmutableOpenHashSet");
boolean ordered = !isModuleEnabled("OrderedSet");
if(ordered) addBlockedFiles("OrderedSet");
boolean hashSet = !isModuleEnabled("HashSet");
boolean hashSet = implementations || !isModuleEnabled("HashSet");
if(hashSet) addBlockedFiles("OpenHashSet");
if(hashSet || ordered || !isModuleEnabled("LinkedHashSet")) addBlockedFiles("LinkedOpenHashSet");
boolean customHashSet = !isModuleEnabled("CustomHashSet");
boolean customHashSet = implementations || !isModuleEnabled("CustomHashSet");
if(customHashSet) addBlockedFiles("OpenCustomHashSet");
if(customHashSet || ordered || !isModuleEnabled("LinkedCustomHashSet")) addBlockedFiles("LinkedOpenCustomHashSet");
if(ordered || !isModuleEnabled("ArraySet")) addBlockedFiles("ArraySet");
if(implementations || ordered || !isModuleEnabled("ArraySet")) addBlockedFiles("ArraySet");
boolean sorted = !isModuleEnabled("SortedSet");
if(sorted) addBlockedFiles("SortedSet", "NavigableSet");
if(sorted || !isModuleEnabled("AVLTreeSet")) addBlockedFiles("AVLTreeSet");
if(sorted || !isModuleEnabled("RBTreeSet")) addBlockedFiles("RBTreeSet");
if(implementations || sorted || !isModuleEnabled("AVLTreeSet")) addBlockedFiles("AVLTreeSet");
if(implementations || sorted || !isModuleEnabled("RBTreeSet")) addBlockedFiles("RBTreeSet");
if(keyType == ClassType.BOOLEAN)
{

View File

@ -27,14 +27,14 @@ import speiger.src.collections.PACKAGE.functions.function.PREDICATE;
import speiger.src.collections.PACKAGE.functions.function.TO_OBJECT_FUNCTION;
#endif
import speiger.src.collections.PACKAGE.functions.function.UNARY_OPERATOR;
#if OBJECT_ASYNC_MODULE
#if ARRAY_LIST_FEATURE || LINKED_LIST_FEATURE
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
#endif
#if !TYPE_BOOLEAN && OBJECT_ASYNC_MODULE
#if SET_MODULE
import speiger.src.collections.PACKAGE.sets.SET;

View File

@ -16,14 +16,14 @@ import speiger.src.collections.PACKAGE.functions.COMPARATOR;
#endif
import speiger.src.collections.PACKAGE.functions.function.TO_OBJECT_FUNCTION;
import speiger.src.collections.PACKAGE.functions.function.PREDICATE;
#if LIST_MODULE
#if ARRAY_LIST_FEATURE || LINKED_LIST_FEATURE
import speiger.src.collections.PACKAGE.lists.LIST;
#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
import speiger.src.collections.PACKAGE.lists.LIST;
#endif
import speiger.src.collections.PACKAGE.lists.LIST_ITERATOR;
import speiger.src.collections.PACKAGE.collections.BI_ITERATOR;