JPP: first pig sized baseX impl failed, added nether ring tone for later
This commit is contained in:
parent
631e1d8a25
commit
afff1297b2
3 changed files with 141 additions and 27 deletions
|
|
@ -28,7 +28,6 @@
|
|||
package ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᐪᓫᣗᔿᑊᣕᣔᐪᐤᣗ;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.annotation.Documented;
|
||||
import java.nio.file.FileSystems;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
|
|
@ -42,10 +41,65 @@ public class StibitsGenerator {
|
|||
|
||||
public static void main(String[] args) throws IOException {
|
||||
StibitsGenerator gen = new StibitsGenerator();
|
||||
gen.update(Arrays.asList(args).contains("generate"));
|
||||
boolean writeToFile = Arrays.asList(args).contains("generate");
|
||||
if (Arrays.asList(args).contains("stibits")) {
|
||||
gen.updateStibitz(writeToFile);
|
||||
} else if (Arrays.asList(args).contains("based")) {
|
||||
gen.updateBased(writeToFile);
|
||||
} else {
|
||||
System.err.println("No command given.");
|
||||
}
|
||||
}
|
||||
|
||||
private void update(boolean writeToFile) throws IOException {
|
||||
@Deprecated // breaks eclipse, todo rewrite to nether types
|
||||
private void updateBased(boolean writeToFile) throws IOException {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
generateHeaderPrelog(buf);
|
||||
generateHeaderBased(buf);
|
||||
buf.append("public enum PrimordialOrdinalBased");
|
||||
buf.append(" {\n");
|
||||
buf.append("\t;\n");
|
||||
|
||||
buf.append("\tprivate interface PrimordialOrdinalMutexBaseX {\n");
|
||||
buf.append("\t}\n");
|
||||
buf.append("\tprivate interface PrimordialOrdinalMutex<T extends PrimordialOrdinalMutexBaseX> extends PrimordialOrdinalSpaceLimit {\n");
|
||||
buf.append("\t}\n");
|
||||
buf.append("\t\n");
|
||||
for (int i = 1 ; i <= 2304; i++) {
|
||||
String partCode = String.format("PART_%04d", i);
|
||||
String clsMutex = "PrimordialOrdinalMutexBase" + i;
|
||||
String clsMutexPrev = "PrimordialOrdinalMutexBase" + (i - 1);
|
||||
if (i == 1) {
|
||||
clsMutexPrev = "PrimordialOrdinalMutexBaseX";
|
||||
}
|
||||
buf.append("\tprivate interface "+clsMutex+" extends "+clsMutexPrev+" {\n");
|
||||
buf.append("\t\tstatic final int " + partCode + " = " + (i - 1) + ";\n");
|
||||
buf.append("\t}\n");
|
||||
}
|
||||
buf.append("\t\n");
|
||||
for (int i = 1 ; i <= 2304; i++) {
|
||||
String partCode = String.format("PART_%04d", i);
|
||||
String clsBase = "PrimordialOrdinalBase" + i;
|
||||
String clsMutex = "PrimordialOrdinalMutexBase" + i;
|
||||
String clsMutexExt = ", PrimordialOrdinalMutex<" + clsMutex + ">";
|
||||
buf.append("\tpublic interface "+clsBase+" extends "+clsMutex+clsMutexExt+" {\n");
|
||||
buf.append("\t\t@Override\n");
|
||||
buf.append("\t\tdefault int ordinalSpaceLimit() {\n");
|
||||
buf.append("\t\t\treturn " + partCode + ";\n");
|
||||
buf.append("\t\t}\n");
|
||||
buf.append("\t}\n");
|
||||
}
|
||||
buf.append("\t\n");
|
||||
buf.append("}\n");
|
||||
String based = buf.toString();
|
||||
Path clazz = FileSystems.getDefault().getPath("src/main/java/ᒢᐩᐩ/ᒡᒢᑊᒻᒻᓫᔿ/PrimordialOrdinalBased.java");
|
||||
if (writeToFile) {
|
||||
Files.writeString(clazz, based);
|
||||
}
|
||||
System.out.println(based);
|
||||
}
|
||||
|
||||
private void updateStibitz(boolean writeToFile) throws IOException {
|
||||
String maxDigitNumber = Integer.toString(999);
|
||||
StringBuilder maxDigitFormat = new StringBuilder();
|
||||
for (int i=ᒢℭỗᶇṧⱦᶏꬼȶʂ.INTᣟᐧᣟZERO;i<maxDigitNumber.length();i++) {
|
||||
|
|
@ -54,7 +108,8 @@ public class StibitsGenerator {
|
|||
for (int pieType:TTꞱꞱᖟGateway.亞.bakedPieSlices()) {
|
||||
String terminator = new DecimalFormat(maxDigitFormat.toString()).format(pieType);
|
||||
StringBuilder buf = new StringBuilder();
|
||||
generateHeader(buf, terminator);
|
||||
generateHeaderPrelog(buf);
|
||||
generateHeaderStibitz(buf, terminator);
|
||||
String clazzName = "T" + terminator + "ᖟᙾ";
|
||||
buf.append("public enum ");
|
||||
buf.append(clazzName);
|
||||
|
|
@ -110,7 +165,7 @@ public class StibitsGenerator {
|
|||
buf.append("\t}\n");
|
||||
}
|
||||
|
||||
private void generateHeader(StringBuilder buf, String terminator) {
|
||||
private void generateHeaderPrelog(StringBuilder buf) {
|
||||
buf.append("/*\n");
|
||||
buf.append(" * Copyright ©Δ∞ 仙上主天\n");
|
||||
buf.append(" * All rights reserved.\n");
|
||||
|
|
@ -138,6 +193,9 @@ public class StibitsGenerator {
|
|||
buf.append(" * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n");
|
||||
buf.append(" */\n");
|
||||
buf.append("\n");
|
||||
}
|
||||
|
||||
private void generateHeaderStibitz(StringBuilder buf, String terminator) {
|
||||
buf.append("package ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᐪᓫᣗᔿᑊᣕᣔᐪᐤᣗ.ᔆᐪᑊᒃᑊᐪᙆ;\n");
|
||||
buf.append("\n");
|
||||
buf.append("import java.lang.annotation.Documented;\n");
|
||||
|
|
@ -156,4 +214,14 @@ public class StibitsGenerator {
|
|||
buf.append("@DuytsDocAuthor注(name = \"للَّٰهِilLצسُو\", copyright = \"©Δ∞ 仙上主天\")\n");
|
||||
buf.append("@ᐊᐅᓚᔾᔭᒋᐊᖅᓯᒪᔪᖅ(ᐆᒧᖓ = \"𑀳𑁂𑀮𑀺𑀉𑁄𑀤𑁄𑀭𑁂𑀡𑀪𑀸𑀕\")\n");
|
||||
}
|
||||
|
||||
private void generateHeaderBased(StringBuilder buf) {
|
||||
buf.append("package ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ;\n");
|
||||
buf.append("\n");
|
||||
buf.append("import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣔᣕᣕᐤᐪᣔᐪᑊᐤᣕ.ᐧᣞᣛ.ᐊᐅᓚᔾᔭᒋᐊᖅᓯᒪᔪᖅ;\n");
|
||||
buf.append("import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;\n");
|
||||
buf.append("\n");
|
||||
buf.append("@DuytsDocAuthor注(name = \"للَّٰهِilLצسُو\", copyright = \"©Δ∞ 仙上主天\")\n");
|
||||
buf.append("@ᐊᐅᓚᔾᔭᒋᐊᖅᓯᒪᔪᖅ(ᐆᒧᖓ = \"𑀳𑁂𑀮𑀺𑀉𑁄𑀤𑁄𑀭𑁂𑀡𑀪𑀸𑀕\")\n");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue