Finishing Framework and making Async Module Optional.

This commit is contained in:
Speiger 2022-12-04 07:56:04 +01:00
parent 6722f399db
commit b29874189c
15 changed files with 188 additions and 127 deletions

View File

@ -9,108 +9,10 @@
"PriorityQueue": true, "PriorityQueue": true,
"Set": true, "Set": true,
"Boolean": { "Boolean": {
"enabled": true,
"Base": { "Base": {
"enabled": true "enabled": true
}, },
"Boolean": {
"Function": {
"enabled": true
},
"Map": {
"enabled": true
},
"Pair": {
"enabled": true
}
},
"Byte": {
"Function": {
"enabled": true
},
"Map": {
"enabled": true
},
"Pair": {
"enabled": true
}
},
"Short": {
"Function": {
"enabled": true
},
"Map": {
"enabled": true
},
"Pair": {
"enabled": true
}
},
"Character": {
"Function": {
"enabled": true
},
"Map": {
"enabled": true
},
"Pair": {
"enabled": true
}
},
"Integer": {
"Function": {
"enabled": true
},
"Map": {
"enabled": true
},
"Pair": {
"enabled": true
}
},
"Long": {
"Function": {
"enabled": true
},
"Map": {
"enabled": true
},
"Pair": {
"enabled": true
}
},
"Float": {
"Function": {
"enabled": true
},
"Map": {
"enabled": true
},
"Pair": {
"enabled": true
}
},
"Double": {
"Function": {
"enabled": true
},
"Map": {
"enabled": true
},
"Pair": {
"enabled": true
}
},
"Object": {
"Function": {
"enabled": true
},
"Map": {
"enabled": true
},
"Pair": {
"enabled": true
}
},
"Collection": { "Collection": {
"enabled": true "enabled": true
}, },
@ -128,10 +30,12 @@
} }
}, },
"Byte": { "Byte": {
"enabled": true,
"Base": { "Base": {
"enabled": true "enabled": true
}, },
"Boolean": { "Boolean": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -143,6 +47,7 @@
} }
}, },
"Byte": { "Byte": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -154,6 +59,7 @@
} }
}, },
"Short": { "Short": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -165,6 +71,7 @@
} }
}, },
"Character": { "Character": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -176,6 +83,7 @@
} }
}, },
"Integer": { "Integer": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -187,6 +95,7 @@
} }
}, },
"Long": { "Long": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -198,6 +107,7 @@
} }
}, },
"Float": { "Float": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -209,6 +119,7 @@
} }
}, },
"Double": { "Double": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -220,6 +131,7 @@
} }
}, },
"Object": { "Object": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -247,10 +159,12 @@
} }
}, },
"Short": { "Short": {
"enabled": true,
"Base": { "Base": {
"enabled": true "enabled": true
}, },
"Boolean": { "Boolean": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -262,6 +176,7 @@
} }
}, },
"Byte": { "Byte": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -273,6 +188,7 @@
} }
}, },
"Short": { "Short": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -284,6 +200,7 @@
} }
}, },
"Character": { "Character": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -295,6 +212,7 @@
} }
}, },
"Integer": { "Integer": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -306,6 +224,7 @@
} }
}, },
"Long": { "Long": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -317,6 +236,7 @@
} }
}, },
"Float": { "Float": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -328,6 +248,7 @@
} }
}, },
"Double": { "Double": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -339,6 +260,7 @@
} }
}, },
"Object": { "Object": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -366,10 +288,12 @@
} }
}, },
"Character": { "Character": {
"enabled": true,
"Base": { "Base": {
"enabled": true "enabled": true
}, },
"Boolean": { "Boolean": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -381,6 +305,7 @@
} }
}, },
"Byte": { "Byte": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -392,6 +317,7 @@
} }
}, },
"Short": { "Short": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -403,6 +329,7 @@
} }
}, },
"Character": { "Character": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -414,6 +341,7 @@
} }
}, },
"Integer": { "Integer": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -425,6 +353,7 @@
} }
}, },
"Long": { "Long": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -436,6 +365,7 @@
} }
}, },
"Float": { "Float": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -447,6 +377,7 @@
} }
}, },
"Double": { "Double": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -458,6 +389,7 @@
} }
}, },
"Object": { "Object": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -485,10 +417,12 @@
} }
}, },
"Integer": { "Integer": {
"enabled": true,
"Base": { "Base": {
"enabled": true "enabled": true
}, },
"Boolean": { "Boolean": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -500,6 +434,7 @@
} }
}, },
"Byte": { "Byte": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -511,6 +446,7 @@
} }
}, },
"Short": { "Short": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -522,6 +458,7 @@
} }
}, },
"Character": { "Character": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -533,6 +470,7 @@
} }
}, },
"Integer": { "Integer": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -544,6 +482,7 @@
} }
}, },
"Long": { "Long": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -555,6 +494,7 @@
} }
}, },
"Float": { "Float": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -566,6 +506,7 @@
} }
}, },
"Double": { "Double": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -577,6 +518,7 @@
} }
}, },
"Object": { "Object": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -604,10 +546,12 @@
} }
}, },
"Long": { "Long": {
"enabled": true,
"Base": { "Base": {
"enabled": true "enabled": true
}, },
"Boolean": { "Boolean": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -619,6 +563,7 @@
} }
}, },
"Byte": { "Byte": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -630,6 +575,7 @@
} }
}, },
"Short": { "Short": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -641,6 +587,7 @@
} }
}, },
"Character": { "Character": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -652,6 +599,7 @@
} }
}, },
"Integer": { "Integer": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -663,6 +611,7 @@
} }
}, },
"Long": { "Long": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -674,6 +623,7 @@
} }
}, },
"Float": { "Float": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -685,6 +635,7 @@
} }
}, },
"Double": { "Double": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -696,6 +647,7 @@
} }
}, },
"Object": { "Object": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -723,10 +675,12 @@
} }
}, },
"Float": { "Float": {
"enabled": true,
"Base": { "Base": {
"enabled": true "enabled": true
}, },
"Boolean": { "Boolean": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -738,6 +692,7 @@
} }
}, },
"Byte": { "Byte": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -749,6 +704,7 @@
} }
}, },
"Short": { "Short": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -760,6 +716,7 @@
} }
}, },
"Character": { "Character": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -771,6 +728,7 @@
} }
}, },
"Integer": { "Integer": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -782,6 +740,7 @@
} }
}, },
"Long": { "Long": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -793,6 +752,7 @@
} }
}, },
"Float": { "Float": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -804,6 +764,7 @@
} }
}, },
"Double": { "Double": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -815,6 +776,7 @@
} }
}, },
"Object": { "Object": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -842,10 +804,12 @@
} }
}, },
"Double": { "Double": {
"enabled": true,
"Base": { "Base": {
"enabled": true "enabled": true
}, },
"Boolean": { "Boolean": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -857,6 +821,7 @@
} }
}, },
"Byte": { "Byte": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -868,6 +833,7 @@
} }
}, },
"Short": { "Short": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -879,6 +845,7 @@
} }
}, },
"Character": { "Character": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -890,6 +857,7 @@
} }
}, },
"Integer": { "Integer": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -901,6 +869,7 @@
} }
}, },
"Long": { "Long": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -912,6 +881,7 @@
} }
}, },
"Float": { "Float": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -923,6 +893,7 @@
} }
}, },
"Double": { "Double": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -934,6 +905,7 @@
} }
}, },
"Object": { "Object": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -961,10 +933,12 @@
} }
}, },
"Object": { "Object": {
"enabled": true,
"Base": { "Base": {
"enabled": true "enabled": true
}, },
"Boolean": { "Boolean": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -976,6 +950,7 @@
} }
}, },
"Byte": { "Byte": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -987,6 +962,7 @@
} }
}, },
"Short": { "Short": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -998,6 +974,7 @@
} }
}, },
"Character": { "Character": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -1009,6 +986,7 @@
} }
}, },
"Integer": { "Integer": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -1020,6 +998,7 @@
} }
}, },
"Long": { "Long": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -1031,6 +1010,7 @@
} }
}, },
"Float": { "Float": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -1042,6 +1022,7 @@
} }
}, },
"Double": { "Double": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },
@ -1053,6 +1034,7 @@
} }
}, },
"Object": { "Object": {
"enabled": true,
"Function": { "Function": {
"enabled": true "enabled": true
}, },

View File

@ -239,7 +239,7 @@ public class PrimitiveCollectionsBuilder extends TemplateProcessor
boolean tests = flags.contains("tests"); boolean tests = flags.contains("tests");
boolean forceTests = flags.contains("force-tests"); boolean forceTests = flags.contains("force-tests");
boolean load = flags.contains("load"); boolean load = flags.contains("load");
boolean save = !flags.contains("save"); boolean save = flags.contains("save");
int flag = (load ? LOAD : 0) | (save ? SAVE : 0); int flag = (load ? LOAD : 0) | (save ? SAVE : 0);
// new PrimitiveCollectionsBuilder(silent).test(); // new PrimitiveCollectionsBuilder(silent).test();
new PrimitiveCollectionsBuilder(silent).setFlags(flag).process(force); new PrimitiveCollectionsBuilder(silent).setFlags(flag).process(force);

View File

@ -20,13 +20,30 @@ public class SettingsManager
JsonObject data = new JsonObject(); JsonObject data = new JsonObject();
Set<String> moduleNames = new TreeSet<>(String.CASE_INSENSITIVE_ORDER); Set<String> moduleNames = new TreeSet<>(String.CASE_INSENSITIVE_ORDER);
public boolean isModuleEnabled(BaseModule base, ClassType keyType, ClassType valueType) {
if(!loaded) return true;
if(!isEnabled(data, base.getModuleName())) return false;
JsonObject result = getObject(data, keyType.getClassPath(), false);
if(!isEnabled(result, "enabled")) return false;
if(base.isBiModule()) {
result = getObject(result, valueType.getClassPath(), false);
if(!isEnabled(result, "enabled")) return false;
}
result = getObject(result, base.getModuleName(), false);
return result.size() <= 0 || isEnabled(result, "enabled");
}
public boolean isModuleEnabled(BaseModule base, ClassType keyType, ClassType valueType, String entry) public boolean isModuleEnabled(BaseModule base, ClassType keyType, ClassType valueType, String entry)
{ {
if(!loaded) return true; if(!loaded) return true;
if(!isEnabled(data, base.getModuleName())) return false; if(!isEnabled(data, base.getModuleName())) return false;
JsonObject result = getObject(data, keyType.getClassPath()); JsonObject result = getObject(data, keyType.getClassPath(), false);
if(base.isBiModule()) result = getObject(result, valueType.getClassPath()); if(!isEnabled(result, "enabled")) return false;
result = getObject(result, base.getModuleName()); if(base.isBiModule()) {
result = getObject(result, valueType.getClassPath(), false);
if(!isEnabled(result, "enabled")) return false;
}
result = getObject(result, base.getModuleName(), false);
return result.size() <= 0 || (isEnabled(result, "enabled") && isEnabled(result, entry)); return result.size() <= 0 || (isEnabled(result, "enabled") && isEnabled(result, entry));
} }
@ -37,6 +54,7 @@ public class SettingsManager
data.addProperty(moduleName, true); data.addProperty(moduleName, true);
if(module.isBiModule()) { if(module.isBiModule()) {
for(ClassType keyType : ModulePackage.TYPE) { for(ClassType keyType : ModulePackage.TYPE) {
if(keyType == ClassType.BOOLEAN) continue;
for(ClassType valueType : ModulePackage.TYPE) { for(ClassType valueType : ModulePackage.TYPE) {
JsonObject obj = new JsonObject(); JsonObject obj = new JsonObject();
obj.addProperty("enabled", true); obj.addProperty("enabled", true);
@ -82,18 +100,19 @@ public class SettingsManager
} }
private void addModule(ClassType keyType, ClassType valueType, boolean bi, String moduleName, JsonObject obj) { private void addModule(ClassType keyType, ClassType valueType, boolean bi, String moduleName, JsonObject obj) {
JsonObject result = getObject(data, keyType.getClassPath()); JsonObject result = getObject(data, keyType.getClassPath(), true);
if(bi) { if(bi) {
result = getObject(result, valueType.getClassPath()); result = getObject(result, valueType.getClassPath(), true);
} }
result.add(moduleName, obj); result.add(moduleName, obj);
} }
private JsonObject getObject(JsonObject data, String name) { private JsonObject getObject(JsonObject data, String name, boolean create) {
JsonObject obj = data.getAsJsonObject(name); JsonObject obj = data.getAsJsonObject(name);
if(obj == null) { if(obj == null) {
obj = new JsonObject(); obj = new JsonObject();
data.add(name, obj); data.add(name, obj);
if(create) obj.addProperty("enabled", true);
} }
return obj; return obj;
} }

View File

@ -14,11 +14,24 @@ public class AsyncModule extends BaseModule
@Override @Override
protected void loadFunctions() {} protected void loadFunctions() {}
@Override @Override
protected void loadFlags() {} protected void loadBlockades() {
if(!isModuleEnabled()) {
addBlockedFiles("AsyncBuilder");
}
}
@Override
protected void loadFlags() {
if(isModuleEnabled()) {
addKeyFlag("ASYNC_MODULE");
}
}
@Override @Override
protected void loadClasses() protected void loadClasses()
{ {
//Implementation Classes
addClassMapper("ASYNC_BUILDER", "AsyncBuilder");
//Abstract Classes //Abstract Classes
addAbstractMapper("BASE_TASK", "Base%sTask"); addAbstractMapper("BASE_TASK", "Base%sTask");

View File

@ -35,6 +35,7 @@ public abstract class BaseModule
loadTestClasses(); loadTestClasses();
loadFunctions(); loadFunctions();
loadRemappers(); loadRemappers();
loadBlockades();
loadFlags(); loadFlags();
} }
@ -50,21 +51,30 @@ public abstract class BaseModule
protected abstract void loadTestClasses(); protected abstract void loadTestClasses();
protected abstract void loadFunctions(); protected abstract void loadFunctions();
protected abstract void loadRemappers(); protected abstract void loadRemappers();
protected abstract void loadBlockades();
protected abstract void loadFlags(); protected abstract void loadFlags();
public abstract String getModuleName(); public abstract String getModuleName();
public boolean isBiModule() { return false; } public boolean isBiModule() { return false; }
public Set<String> getModuleKeys(ClassType keyType, ClassType valueType) { return Collections.emptySet(); } public Set<String> getModuleKeys(ClassType keyType, ClassType valueType) { return Collections.emptySet(); }
protected boolean isModuleEnabled() {
return manager == null || manager.isModuleEnabled(this, keyType, valueType);
}
protected boolean isModuleEnabled(String name) { protected boolean isModuleEnabled(String name) {
if(manager == null) return true; return manager == null || manager.isModuleEnabled(this, keyType, valueType, name);
return manager.isModuleEnabled(this, keyType, valueType, name);
} }
protected void addFlag(String name) { protected void addFlag(String name) {
entry.addFlag(name); entry.addFlag(name);
} }
protected void addKeyFlag(String name) {
entry.addFlag(name);
entry.addFlag(keyType.getCapType()+"_"+name);
}
protected void addBiRequirement(String fileName) { protected void addBiRequirement(String fileName) {
entry.addRequirement(fileName, RequiredType.BI_CLASS); entry.addRequirement(fileName, RequiredType.BI_CLASS);
entry.addSplitter(fileName, "%1$s2%2$s"); entry.addSplitter(fileName, "%1$s2%2$s");

View File

@ -8,11 +8,12 @@ public class CollectionModule extends BaseModule
@Override @Override
public String getModuleName() { return "Collection"; } public String getModuleName() { return "Collection"; }
@Override @Override
protected void loadVariables() { loadBlockades(); } protected void loadVariables() {}
@Override @Override
protected void loadFlags() {} protected void loadFlags() {}
private void loadBlockades() @Override
protected void loadBlockades()
{ {
if(keyType.isObject()) { if(keyType.isObject()) {
addBlockedFiles("Stack"); addBlockedFiles("Stack");

View File

@ -8,13 +8,14 @@ public class FunctionModule extends BaseModule
@Override @Override
public boolean isBiModule() { return true; } public boolean isBiModule() { return true; }
@Override @Override
protected void loadVariables() { loadBlockades(); } protected void loadVariables() {}
@Override @Override
protected void loadFlags() {} protected void loadFlags() {}
@Override @Override
protected void loadTestClasses() {} protected void loadTestClasses() {}
private void loadBlockades() @Override
protected void loadBlockades()
{ {
if(keyType.isObject()) addBlockedFiles("Consumer", "Comparator"); if(keyType.isObject()) addBlockedFiles("Consumer", "Comparator");
} }

View File

@ -30,7 +30,9 @@ public class JavaModule extends BaseModule
@Override @Override
protected void loadRemappers() {} protected void loadRemappers() {}
@Override
protected void loadBlockades() {}
@Override @Override
protected void loadFunctions() protected void loadFunctions()
{ {

View File

@ -8,11 +8,14 @@ public class ListModule extends BaseModule
@Override @Override
public String getModuleName() { return "List"; } public String getModuleName() { return "List"; }
@Override @Override
protected void loadVariables() { loadBlockedFiles(); } protected void loadVariables() {}
@Override @Override
protected void loadFlags() {} protected void loadFlags() {
}
private void loadBlockedFiles() @Override
protected void loadBlockades()
{ {
if(keyType.isObject()) { if(keyType.isObject()) {
addBlockedFiles("ListFillBufferTester"); addBlockedFiles("ListFillBufferTester");
@ -52,7 +55,6 @@ public class ListModule extends BaseModule
//Implementation Classes //Implementation Classes
addClassMapper("ARRAY_LIST", "ArrayList"); addClassMapper("ARRAY_LIST", "ArrayList");
addAbstractMapper("COPY_ON_WRITE_LIST", "CopyOnWrite%sArrayList"); addAbstractMapper("COPY_ON_WRITE_LIST", "CopyOnWrite%sArrayList");
addClassMapper("ASYNC_BUILDER", "AsyncBuilder");
addClassMapper("LINKED_LIST", "LinkedList"); addClassMapper("LINKED_LIST", "LinkedList");
addAbstractMapper("IMMUTABLE_LIST", "Immutable%sList"); addAbstractMapper("IMMUTABLE_LIST", "Immutable%sList");

View File

@ -10,11 +10,12 @@ public class MapModule extends BaseModule
@Override @Override
public boolean isBiModule() { return true; } public boolean isBiModule() { return true; }
@Override @Override
protected void loadVariables() { loadBlockades(); } protected void loadVariables() {}
@Override @Override
protected void loadFlags() {} protected void loadFlags() {}
private void loadBlockades() @Override
protected void loadBlockades()
{ {
if(keyType == ClassType.BOOLEAN) if(keyType == ClassType.BOOLEAN)
{ {

View File

@ -10,6 +10,8 @@ public class PairModule extends BaseModule
@Override @Override
protected void loadVariables() {} protected void loadVariables() {}
@Override @Override
protected void loadBlockades() {}
@Override
protected void loadFlags() {} protected void loadFlags() {}
@Override @Override
protected void loadFunctions() {} protected void loadFunctions() {}

View File

@ -8,13 +8,14 @@ public class PrioQueueModule extends BaseModule
@Override @Override
public String getModuleName() { return "PriorityQueue"; } public String getModuleName() { return "PriorityQueue"; }
@Override @Override
protected void loadVariables() { loadBlockades(); } protected void loadVariables() {}
@Override @Override
protected void loadFlags() {} protected void loadFlags() {}
@Override @Override
protected void loadFunctions() {} protected void loadFunctions() {}
private void loadBlockades() @Override
protected void loadBlockades()
{ {
if(keyType == ClassType.BOOLEAN) { if(keyType == ClassType.BOOLEAN) {
addBlockedFiles("QueueTests"); addBlockedFiles("QueueTests");

View File

@ -8,11 +8,12 @@ public class SetModule extends BaseModule
@Override @Override
public String getModuleName() { return "Set"; } public String getModuleName() { return "Set"; }
@Override @Override
protected void loadVariables() { loadBlockades(); } protected void loadVariables() {}
@Override @Override
protected void loadFlags() {} protected void loadFlags() {}
private void loadBlockades() @Override
protected void loadBlockades()
{ {
if(keyType == ClassType.BOOLEAN) if(keyType == ClassType.BOOLEAN)
{ {

View File

@ -23,7 +23,9 @@ import speiger.src.collections.PACKAGE.lists.ARRAY_LIST;
import speiger.src.collections.PACKAGE.sets.SET; import speiger.src.collections.PACKAGE.sets.SET;
import speiger.src.collections.PACKAGE.sets.LINKED_HASH_SET; import speiger.src.collections.PACKAGE.sets.LINKED_HASH_SET;
#endif #endif
#if ASYNC_MODULE
import speiger.src.collections.PACKAGE.utils.ASYNC_BUILDER; import speiger.src.collections.PACKAGE.utils.ASYNC_BUILDER;
#endif
import speiger.src.collections.PACKAGE.utils.SPLIT_ITERATORS; import speiger.src.collections.PACKAGE.utils.SPLIT_ITERATORS;
import speiger.src.collections.PACKAGE.utils.ITERABLES; import speiger.src.collections.PACKAGE.utils.ITERABLES;
import speiger.src.collections.PACKAGE.utils.ITERATORS; import speiger.src.collections.PACKAGE.utils.ITERATORS;
@ -93,6 +95,7 @@ public interface ITERABLE KEY_GENERIC_TYPE extends Iterable<CLASS_TYPE>
@Override @Override
default SPLIT_ITERATOR KEY_GENERIC_TYPE spliterator() { return SPLIT_ITERATORS.createUnknownSplititerator(iterator(), 0); } default SPLIT_ITERATOR KEY_GENERIC_TYPE spliterator() { return SPLIT_ITERATORS.createUnknownSplititerator(iterator(), 0); }
#if ASYNC_MODULE
/** /**
* Creates a Async Builder for moving work of the thread. * Creates a Async Builder for moving work of the thread.
* It is not designed to split the work to multithreaded work, so using this keep it singlethreaded, but it allows to be moved to another thread. * It is not designed to split the work to multithreaded work, so using this keep it singlethreaded, but it allows to be moved to another thread.
@ -103,6 +106,7 @@ public interface ITERABLE KEY_GENERIC_TYPE extends Iterable<CLASS_TYPE>
return new ASYNC_BUILDERBRACES(this); return new ASYNC_BUILDERBRACES(this);
} }
#endif
/** /**
* A Helper function to reduce the usage of Streams and allows to convert a Iterable to something else. * A Helper function to reduce the usage of Streams and allows to convert a Iterable to something else.
* @param mapper the mapping function * @param mapper the mapping function

View File

@ -17,27 +17,33 @@ import java.util.Comparator;
#endif #endif
import speiger.src.collections.PACKAGE.collections.ITERABLE; import speiger.src.collections.PACKAGE.collections.ITERABLE;
#if OBJECT_ASYNC_MODULE
import speiger.src.collections.PACKAGE.collections.COLLECTION; import speiger.src.collections.PACKAGE.collections.COLLECTION;
#endif
import speiger.src.collections.PACKAGE.collections.ITERATOR; import speiger.src.collections.PACKAGE.collections.ITERATOR;
import speiger.src.collections.PACKAGE.functions.TASK; import speiger.src.collections.PACKAGE.functions.TASK;
import speiger.src.collections.PACKAGE.functions.function.PREDICATE; import speiger.src.collections.PACKAGE.functions.function.PREDICATE;
#if OBJECT_ASYNC_MODULE
import speiger.src.collections.PACKAGE.functions.function.TO_OBJECT_FUNCTION; import speiger.src.collections.PACKAGE.functions.function.TO_OBJECT_FUNCTION;
#endif
import speiger.src.collections.PACKAGE.functions.function.UNARY_OPERATOR; import speiger.src.collections.PACKAGE.functions.function.UNARY_OPERATOR;
import speiger.src.collections.PACKAGE.lists.ARRAY_LIST; import speiger.src.collections.PACKAGE.lists.ARRAY_LIST;
#if OBJECT_ASYNC_MODULE
import speiger.src.collections.PACKAGE.lists.LIST; import speiger.src.collections.PACKAGE.lists.LIST;
#if !TYPE_BOOLEAN #if !TYPE_BOOLEAN
import speiger.src.collections.PACKAGE.sets.SET; import speiger.src.collections.PACKAGE.sets.SET;
import speiger.src.collections.PACKAGE.sets.LINKED_HASH_SET; import speiger.src.collections.PACKAGE.sets.LINKED_HASH_SET;
#endif #endif
#if !TYPE_BOOLEAN #endif
#if !TYPE_BOOLEAN && BOOLEAN_ASYNC_MODULE
import speiger.src.collections.booleans.utils.BooleanAsyncBuilder; import speiger.src.collections.booleans.utils.BooleanAsyncBuilder;
import speiger.src.collections.booleans.utils.BooleanAsyncBuilder.BaseBooleanTask; import speiger.src.collections.booleans.utils.BooleanAsyncBuilder.BaseBooleanTask;
#endif #endif
#if !TYPE_OBJECT #if !TYPE_OBJECT && OBJECT_ASYNC_MODULE
import speiger.src.collections.objects.utils.ObjectAsyncBuilder; import speiger.src.collections.objects.utils.ObjectAsyncBuilder;
import speiger.src.collections.objects.utils.ObjectAsyncBuilder.BaseObjectTask; import speiger.src.collections.objects.utils.ObjectAsyncBuilder.BaseObjectTask;
#endif #endif
#if !TYPE_INT #if !TYPE_INT && INT_ASYNC_MODULE
import speiger.src.collections.ints.utils.IntAsyncBuilder; import speiger.src.collections.ints.utils.IntAsyncBuilder;
import speiger.src.collections.ints.utils.IntAsyncBuilder.BaseIntTask; import speiger.src.collections.ints.utils.IntAsyncBuilder.BaseIntTask;
#endif #endif
@ -123,6 +129,7 @@ public class ASYNC_BUILDER KEY_GENERIC_TYPE
return new ASYNC_BUILDERBRACES(ARRAY_LIST.wrap(values)); return new ASYNC_BUILDERBRACES(ARRAY_LIST.wrap(values));
} }
#if OBJECT_ASYNC_MODULE
/** /**
* Maps the elements to something else * Maps the elements to something else
* @param mapper the mapping function * @param mapper the mapping function
@ -154,6 +161,7 @@ public class ASYNC_BUILDER KEY_GENERIC_TYPE
return new ObjectAsyncBuilder<>(ITERABLES.arrayFlatMap(iterable, mapper)); return new ObjectAsyncBuilder<>(ITERABLES.arrayFlatMap(iterable, mapper));
} }
#endif
/** /**
* Filters out the unwanted elements out of the Iterable * Filters out the unwanted elements out of the Iterable
* @param filter the elements that should be kept * @param filter the elements that should be kept
@ -214,6 +222,7 @@ public class ASYNC_BUILDER KEY_GENERIC_TYPE
return this; return this;
} }
#if OBJECT_ASYNC_MODULE
/** /**
* Iterates over the Iterable with a desired action * Iterates over the Iterable with a desired action
* @param action that should be applied * @param action that should be applied
@ -223,6 +232,7 @@ public class ASYNC_BUILDER KEY_GENERIC_TYPE
return new ObjectAsyncBuilder<>(new ForEachTask<>(iterable.iterator(), action)); return new ObjectAsyncBuilder<>(new ForEachTask<>(iterable.iterator(), action));
} }
#endif
/** /**
* Reduces the elements inside of the Iterable down to one element * Reduces the elements inside of the Iterable down to one element
* @param operator that reduces the elements. * @param operator that reduces the elements.
@ -257,6 +267,7 @@ public class ASYNC_BUILDER KEY_GENERIC_TYPE
} }
#endif #endif
#if OBJECT_ASYNC_MODULE
/** /**
* Pours all elements into a List that can be later * Pours all elements into a List that can be later
* @return a new Builder with the pour function applied * @return a new Builder with the pour function applied
@ -285,6 +296,8 @@ public class ASYNC_BUILDER KEY_GENERIC_TYPE
return new ObjectAsyncBuilder<>(new CollectTask<>(iterable.iterator(), collection)); return new ObjectAsyncBuilder<>(new CollectTask<>(iterable.iterator(), collection));
} }
#endif
#if BOOLEAN_ASYNC_MODULE
/** /**
* Searches through the elements of the Iterable to find if the desired element is present. * Searches through the elements of the Iterable to find if the desired element is present.
* @param filter that decides the desired elements * @param filter that decides the desired elements
@ -312,6 +325,7 @@ public class ASYNC_BUILDER KEY_GENERIC_TYPE
return new BooleanAsyncBuilder(new MatchTaskBRACES(iterable.iterator(), filter, 2)); return new BooleanAsyncBuilder(new MatchTaskBRACES(iterable.iterator(), filter, 2));
} }
#endif
/** /**
* Searches through the elements of the Iterable to find if the desired element. * Searches through the elements of the Iterable to find if the desired element.
* If not present it will return the default value of the type * If not present it will return the default value of the type
@ -323,6 +337,7 @@ public class ASYNC_BUILDER KEY_GENERIC_TYPE
return this; return this;
} }
#if INT_ASYNC_MODULE
/** /**
* Counts all desired elements inside the Iterable * Counts all desired elements inside the Iterable
* @param filter that decides the desired elements * @param filter that decides the desired elements
@ -332,6 +347,7 @@ public class ASYNC_BUILDER KEY_GENERIC_TYPE
return new IntAsyncBuilder(new CountTaskBRACES(iterable.iterator(), filter)); return new IntAsyncBuilder(new CountTaskBRACES(iterable.iterator(), filter));
} }
#endif
/** /**
* Optional way to add a custom executor that runs this offthread task. * Optional way to add a custom executor that runs this offthread task.
* Can only be set after the action was decided on. * Can only be set after the action was decided on.
@ -512,6 +528,7 @@ public class ASYNC_BUILDER KEY_GENERIC_TYPE
} }
} }
#if BOOLEAN_ASYNC_MODULE
private static class MatchTask KEY_GENERIC_TYPE extends BaseBooleanTask private static class MatchTask KEY_GENERIC_TYPE extends BaseBooleanTask
{ {
ITERATOR KEY_GENERIC_TYPE iter; ITERATOR KEY_GENERIC_TYPE iter;
@ -580,6 +597,7 @@ public class ASYNC_BUILDER KEY_GENERIC_TYPE
} }
} }
#endif
private static class FindFirstTask KEY_GENERIC_TYPE extends BASE_TASK KEY_GENERIC_TYPE private static class FindFirstTask KEY_GENERIC_TYPE extends BASE_TASK KEY_GENERIC_TYPE
{ {
ITERATOR KEY_GENERIC_TYPE iter; ITERATOR KEY_GENERIC_TYPE iter;
@ -614,6 +632,7 @@ public class ASYNC_BUILDER KEY_GENERIC_TYPE
} }
} }
#if INT_ASYNC_MODULE
private static class CountTask KEY_GENERIC_TYPE extends BaseIntTask private static class CountTask KEY_GENERIC_TYPE extends BaseIntTask
{ {
ITERATOR KEY_GENERIC_TYPE iter; ITERATOR KEY_GENERIC_TYPE iter;
@ -648,6 +667,8 @@ public class ASYNC_BUILDER KEY_GENERIC_TYPE
} }
} }
#endif
#if OBJECT_ASYNC_MODULE
private static class CollectTask KSS_GENERIC_TYPE<V, T extends COLLECTION KEY_SPECIAL_GENERIC_TYPE<V>> extends BaseObjectTask<T> private static class CollectTask KSS_GENERIC_TYPE<V, T extends COLLECTION KEY_SPECIAL_GENERIC_TYPE<V>> extends BaseObjectTask<T>
{ {
ITERATOR KEY_SPECIAL_GENERIC_TYPE<V> iter; ITERATOR KEY_SPECIAL_GENERIC_TYPE<V> iter;
@ -704,6 +725,7 @@ public class ASYNC_BUILDER KEY_GENERIC_TYPE
} }
} }
#endif
/** /**
* Base Task of the Actions that can be performed. * Base Task of the Actions that can be performed.
* Allows to simplify the actions that get executed. * Allows to simplify the actions that get executed.