This commit is contained in:
Willem 2022-02-06 17:19:05 +01:00
parent a3f58468f5
commit 36e349c152
20 changed files with 356 additions and 164 deletions

View file

@ -8,19 +8,21 @@ import java.util.Iterator;
import java.util.List;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnClassInfoʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinOpenʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnEnumInstanceʸᴰ;
import love.distributedrebirth.numberxd.base2t.glyph.BãßBȍőnGlyphSetKeyʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnPackageInfoʸᴰ;
import love.distributedrebirth.bassboonyd.jmx.DefaultEnumInstanceᴶᴹˣ;
import love.distributedrebirth.bassboonyd.jmx.GuageCounterᴶᴹˣ;
import love.distributedrebirth.bassboonyd.jmx.MBeanStoreKeyᴶᴹˣ;
import love.distributedrebirth.numberxd.base2t.part.T08PartOctal;
import love.distributedrebirth.numberxd.base2t.type.V072Tong;
import love.distributedrebirth.numberxd.base2t.type.V144Tocta;
/**
* Terminate from and to classical bytes.
*/
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public enum Base2Terminator implements BãßBȍőnEnumInstanceʸᴰ<Base2Terminator> {
@BãßBȍőnClassInfoʸᴰ(name = "Base2Terminator", purpose = "Terminate from and to classical bytes.")
@BãßBȍőnPackageInfoʸᴰ(name = "love.distributedrebirth.numberxd")
public enum Base2Terminator implements DefaultEnumInstanceᴶᴹˣ<Base2Terminator,MBeanStoreKeyᴶᴹˣ> {
INSTANCE;
@ -29,11 +31,28 @@ public enum Base2Terminator implements BãßBȍőnEnumInstanceʸᴰ<Base2Termina
private static final int BLOCK_TOCTA_SIZE = 18;
private static final int SHIFT_8 = 8;
private static final int SHIFT_16 = 16;
private final BãßBȍőnCoffinOpenʸᴰ<BãßBȍőnGlyphSetKeyʸᴰ> BBC = BãßBȍőnCoffinOpenʸᴰ.newInstance();
public BãßBȍőnCoffinʸᴰ<BãßBȍőnGlyphSetKeyʸᴰ> GET_BBC() { return BBC; }
private final GuageCounterᴶᴹˣ readV072TongTypeReads;
private final GuageCounterᴶᴹˣ readV072TongByteWrites;
private final GuageCounterᴶᴹˣ readV144ToctaTypeReads;
private final GuageCounterᴶᴹˣ readV144ToctaByteWrites;
private final GuageCounterᴶᴹˣ writeV072TongByteReads;
private final GuageCounterᴶᴹˣ writeV072TongTypeWrites;
private final GuageCounterᴶᴹˣ writeV144ToctaBytesReads;
private final GuageCounterᴶᴹˣ writeV144ToctaTypeWrites;
private final BãßBȍőnCoffinOpenʸᴰ<MBeanStoreKeyᴶᴹˣ> BBC = BãßBȍőnCoffinOpenʸᴰ.newInstance();
public BãßBȍőnCoffinʸᴰ<MBeanStoreKeyᴶᴹˣ> GET_BBC() { return BBC; }
private Base2Terminator() {
BBC.BOON_INIT(this);
BȍőnJmxInit(MBeanStoreKeyᴶᴹˣ.JMX);
readV072TongTypeReads = BȍőnJmxInitGuageCounter(MBeanStoreKeyᴶᴹˣ.JMX, "readV072TongTypeReads");
readV072TongByteWrites = BȍőnJmxInitGuageCounter(MBeanStoreKeyᴶᴹˣ.JMX, "readV072TongByteWrites");
readV144ToctaTypeReads = BȍőnJmxInitGuageCounter(MBeanStoreKeyᴶᴹˣ.JMX, "readV144ToctaTypeReads");
readV144ToctaByteWrites = BȍőnJmxInitGuageCounter(MBeanStoreKeyᴶᴹˣ.JMX, "readV144ToctaByteWrites");
writeV072TongByteReads = BȍőnJmxInitGuageCounter(MBeanStoreKeyᴶᴹˣ.JMX, "writeV072TongByteReads");
writeV072TongTypeWrites = BȍőnJmxInitGuageCounter(MBeanStoreKeyᴶᴹˣ.JMX, "writeV072TongTypeWrites");
writeV144ToctaBytesReads = BȍőnJmxInitGuageCounter(MBeanStoreKeyᴶᴹˣ.JMX, "writeV144ToctaBytesReads");
writeV144ToctaTypeWrites = BȍőnJmxInitGuageCounter(MBeanStoreKeyᴶᴹˣ.JMX, "writeV144ToctaTypeWrites");
}
public int Bãß2ReadTong(InputStream input, List<V072Tong> output) throws IOException {
@ -49,6 +68,8 @@ public enum Base2Terminator implements BãßBȍőnEnumInstanceʸᴰ<Base2Termina
output.add(new V072Tong(new BaseIteratorOctalAdapter(octals.iterator())));
totalBytes += BLOCK_TONG_SIZE;
}
readV072TongTypeReads.increment(output.size());
readV072TongByteWrites.increment(totalBytes);
return totalBytes;
}
@ -68,6 +89,8 @@ public enum Base2Terminator implements BãßBȍőnEnumInstanceʸᴰ<Base2Termina
output.add(new V144Tocta(new BaseIteratorOctalAdapter(octals.iterator())));
totalBytes += BLOCK_TOCTA_SIZE;
}
readV144ToctaTypeReads.increment(output.size());
readV144ToctaByteWrites.increment(totalBytes);
return totalBytes;
}
@ -86,11 +109,18 @@ public enum Base2Terminator implements BãßBȍőnEnumInstanceʸᴰ<Base2Termina
}
public int Bãß2WriteTong(List<V072Tong> data, OutputStream output) throws IOException {
return Bãß2Write(data, output);
int totalBytes = Bãß2Write(data, output);
writeV072TongByteReads.increment(totalBytes);
writeV072TongTypeWrites.increment(data.size());
return totalBytes;
}
public int Bãß2WriteTocta(List<V144Tocta> data, OutputStream output) throws IOException {
return Bãß2Write(data, output);
int totalBytes = Bãß2Write(data, output);
writeV144ToctaBytesReads.increment(totalBytes);
writeV144ToctaTypeWrites.increment(data.size());
return totalBytes;
}
private <T extends BaseNumber<T>> int Bãß2Write(List<T> data, OutputStream output) throws IOException {

View file

@ -1,7 +1,9 @@
package love.distributedrebirth.numberxd.base2t;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnEnumInstanceʸᴰ;
import love.distributedrebirth.bassboonyd.jmx.DefaultEnumInstanceᴶᴹˣ;
import love.distributedrebirth.bassboonyd.jmx.GuageCounterᴶᴹˣ;
import love.distributedrebirth.bassboonyd.jmx.MBeanStoreKeyᴶᴹˣ;
import love.distributedrebirth.numberxd.base2t.part.BãßBȍőnPartʸᴰ;
import love.distributedrebirth.numberxd.base2t.part.T02PartBinary;
import love.distributedrebirth.numberxd.base2t.part.T03PartTrit;
@ -18,14 +20,53 @@ import love.distributedrebirth.numberxd.base2t.part.T16PartHex;
import love.distributedrebirth.numberxd.base2t.part.T20PartScore;
import love.distributedrebirth.numberxd.base2t.part.T60PartSexagesimal;
import love.distributedrebirth.bassboonyd.BãßBȍőnClassInfoʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinOpenʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnPackageInfoʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
@BãßBȍőnClassInfoʸᴰ(name = "BasePartFactory", purpose = "Factory to access the bases.")
public enum BasePartFactory implements BãßBȍőnEnumInstanceʸᴰ<BasePartFactory> {
@BãßBȍőnPackageInfoʸᴰ(name = "love.distributedrebirth.numberxd")
public enum BasePartFactory implements DefaultEnumInstanceᴶᴹˣ<BasePartFactory, MBeanStoreKeyᴶᴹˣ> {
INSTANCE;
private final GuageCounterᴶᴹˣ baseT02Reads;
private final GuageCounterᴶᴹˣ baseT03Reads;
private final GuageCounterᴶᴹˣ baseT04Reads;
private final GuageCounterᴶᴹˣ baseT05Reads;
private final GuageCounterᴶᴹˣ baseT06Reads;
private final GuageCounterᴶᴹˣ baseT07Reads;
private final GuageCounterᴶᴹˣ baseT08Reads;
private final GuageCounterᴶᴹˣ baseT09Reads;
private final GuageCounterᴶᴹˣ baseT10Reads;
private final GuageCounterᴶᴹˣ baseT11Reads;
private final GuageCounterᴶᴹˣ baseT12Reads;
private final GuageCounterᴶᴹˣ baseT16Reads;
private final GuageCounterᴶᴹˣ baseT20Reads;
private final GuageCounterᴶᴹˣ baseT60Reads;
private static final int[] SUPPORTED_BASES = {2,3,4,5,6,7,8,9,10,11,12,16,20,60};
private final BãßBȍőnCoffinOpenʸᴰ<MBeanStoreKeyᴶᴹˣ> BBC = BãßBȍőnCoffinOpenʸᴰ.newInstance();
public BãßBȍőnCoffinʸᴰ<MBeanStoreKeyᴶᴹˣ> GET_BBC() { return BBC; }
private BasePartFactory() {
BBC.BOON_INIT(this);
BȍőnJmxInit(MBeanStoreKeyᴶᴹˣ.JMX);
baseT02Reads = BȍőnJmxInitGuageCounter(MBeanStoreKeyᴶᴹˣ.JMX, "baseT02Reads");
baseT03Reads = BȍőnJmxInitGuageCounter(MBeanStoreKeyᴶᴹˣ.JMX, "baseT03Reads");
baseT04Reads = BȍőnJmxInitGuageCounter(MBeanStoreKeyᴶᴹˣ.JMX, "baseT04Reads");
baseT05Reads = BȍőnJmxInitGuageCounter(MBeanStoreKeyᴶᴹˣ.JMX, "baseT05Reads");
baseT06Reads = BȍőnJmxInitGuageCounter(MBeanStoreKeyᴶᴹˣ.JMX, "baseT06Reads");
baseT07Reads = BȍőnJmxInitGuageCounter(MBeanStoreKeyᴶᴹˣ.JMX, "baseT07Reads");
baseT08Reads = BȍőnJmxInitGuageCounter(MBeanStoreKeyᴶᴹˣ.JMX, "baseT08Reads");
baseT09Reads = BȍőnJmxInitGuageCounter(MBeanStoreKeyᴶᴹˣ.JMX, "baseT09Reads");
baseT10Reads = BȍőnJmxInitGuageCounter(MBeanStoreKeyᴶᴹˣ.JMX, "baseT10Reads");
baseT11Reads = BȍőnJmxInitGuageCounter(MBeanStoreKeyᴶᴹˣ.JMX, "baseT11Reads");
baseT12Reads = BȍőnJmxInitGuageCounter(MBeanStoreKeyᴶᴹˣ.JMX, "baseT12Reads");
baseT16Reads = BȍőnJmxInitGuageCounter(MBeanStoreKeyᴶᴹˣ.JMX, "baseT16Reads");
baseT20Reads = BȍőnJmxInitGuageCounter(MBeanStoreKeyᴶᴹˣ.JMX, "baseT20Reads");
baseT60Reads = BȍőnJmxInitGuageCounter(MBeanStoreKeyᴶᴹˣ.JMX, "baseT60Reads");
}
public int[] BãßBases() {
return SUPPORTED_BASES;
@ -34,32 +75,46 @@ public enum BasePartFactory implements BãßBȍőnEnumInstanceʸᴰ<BasePartFact
public BãßBȍőnPartʸᴰ<?>[] BãßBuildPartsByBase(int base) {
switch (base) {
case 2:
baseT02Reads.increment();
return T02PartBinary.values();
case 3:
baseT03Reads.increment();
return T03PartTrit.values();
case 4:
baseT04Reads.increment();
return T04PartQuad.values();
case 5:
baseT05Reads.increment();
return T05PartPental.values();
case 6:
baseT06Reads.increment();
return T06PartSeximal.values();
case 7:
baseT07Reads.increment();
return T07PartPlanIt.values();
case 8:
baseT08Reads.increment();
return T08PartOctal.values();
case 9:
baseT09Reads.increment();
return T09PartNonary.values();
case 10:
baseT10Reads.increment();
return T10PartDecimal.values();
case 11:
baseT11Reads.increment();
return T11PartUndecimal.values();
case 12:
baseT12Reads.increment();
return T12PartUncial.values();
case 16:
baseT16Reads.increment();
return T16PartHex.values();
case 20:
baseT20Reads.increment();
return T20PartScore.values();
case 60:
baseT60Reads.increment();
return T60PartSexagesimal.values();
default:
throw new IllegalArgumentException("Unsupported base: "+base);

View file

@ -4,11 +4,13 @@ import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnClassInfoʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinOpenʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnPackageInfoʸᴰ;
import love.distributedrebirth.numberxd.base2t.part.T10PartDecimal;
import love.distributedrebirth.numberxd.base2t.part.T16PartHex;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
@BãßBȍőnClassInfoʸᴰ(name = "BaseGlyphSet", purpose = "The encoded base scripts.")
@BãßBȍőnPackageInfoʸᴰ(name = "love.distributedrebirth.numberxd")
public enum BaseGlyphSet implements BãßBȍőnGlyphSetʸᴰ<BaseGlyphSet> {
// TODO: ImGui add font for SINHALA
@ -86,5 +88,6 @@ public enum BaseGlyphSet implements BãßBȍőnGlyphSetʸᴰ<BaseGlyphSet> {
BBC.PUT_OBJ(BãßBȍőnGlyphSetKeyʸᴰ.HEXIMALS, hex);
BBC.PUT_OBJ(BãßBȍőnGlyphSetKeyʸᴰ.GEMATRIA, gematria);
BBC.BOON_INIT(this);
this.BȍőnJmxInit(BãßBȍőnGlyphSetKeyʸᴰ.JMX);
}
}

View file

@ -6,6 +6,8 @@ import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinStoreKeyʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public enum BãßBȍőnGlyphSetKeyʸᴰ implements BãßBȍőnCoffinStoreKeyʸᴰ {
JMX,
NUMBERS,
GEMATRIA,
HEXIMALS,

View file

@ -2,10 +2,11 @@ package love.distributedrebirth.numberxd.base2t.glyph;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinStoreʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnEnumSetʸᴰ;
import love.distributedrebirth.bassboonyd.DefaultEnumSetʸᴰ;
import love.distributedrebirth.bassboonyd.jmx.DefaultEnumSetᴶᴹˣ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public interface BãßBȍőnGlyphSetʸᴰ<T extends BãßBȍőnGlyphSetʸᴰ<T>> extends BãßBȍőnEnumSetʸᴰ<T>, BãßBȍőnCoffinStoreʸᴰ<BãßBȍőnGlyphSetKeyʸᴰ> {
public interface BãßBȍőnGlyphSetʸᴰ<T extends BãßBȍőnGlyphSetʸᴰ<T>> extends DefaultEnumSetᴶᴹˣ<T,BãßBȍőnGlyphSetKeyʸᴰ> {
default BaseGlyphSetNumber BȍőnGlyphSetNumber10() {
return GET_BBC().GET_OBJ(BãßBȍőnGlyphSetKeyʸᴰ.NUMBERS, BaseGlyphSetNumber.class);

View file

@ -6,12 +6,12 @@ import java.util.stream.Collectors;
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinOpenʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinStoreʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnEnumSetʸᴰ;
import love.distributedrebirth.bassboonyd.DefaultEnumSetʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnInitMethodʸᴰ;
import love.distributedrebirth.numberxd.base2t.glyph.BaseGlyphSet;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
public interface BãßBȍőnPartʸᴰ<T extends BãßBȍőnPartʸᴰ<T>> extends BãßBȍőnEnumSetʸᴰ<T>, BãßBȍőnCoffinStoreʸᴰ<BãßBȍőnPartKeyʸᴰ> {
public interface BãßBȍőnPartʸᴰ<T extends BãßBȍőnPartʸᴰ<T>> extends DefaultEnumSetʸᴰ<T>, BãßBȍőnCoffinStoreʸᴰ<BãßBȍőnPartKeyʸᴰ> {
@BãßBȍőnInitMethodʸᴰ
default void initMapTone(BãßBȍőnCoffinOpenʸᴰ<BãßBȍőnPartKeyʸᴰ> BBC) {

View file

@ -7,11 +7,10 @@ import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnClassInfoʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinOpenʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnEnumInstanceʸᴰ;
import love.distributedrebirth.bassboonyd.BãßBȍőnPackageInfoʸᴰ;
import love.distributedrebirth.bassboonyd.jmx.BooleanAttributeᴶᴹˣ;
import love.distributedrebirth.bassboonyd.jmx.MBeanStoreKeyᴶᴹˣ;
import love.distributedrebirth.bassboonyd.jmx.BãßBȍőnEnumJmxʸᴰ;
import love.distributedrebirth.bassboonyd.jmx.DefaultEnumInstanceᴶᴹˣ;
import love.distributedrebirth.bassboonyd.jmx.GuageCounterᴶᴹˣ;
import love.distributedrebirth.bassboonyd.jmx.StringAttributeᴶᴹˣ;
import love.distributedrebirth.numberxd.base2t.BasePartFactory;
@ -21,18 +20,17 @@ import love.distributedrebirth.numberxd.base2t.part.BãßBȍőnPartʸᴰ;
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
@BãßBȍőnClassInfoʸᴰ(name = "TOSWarpCore", purpose = "The warpcore writer and armor manager.")
@BãßBȍőnPackageInfoʸᴰ(name = "love.distributedrebirth.numberxd")
public enum TOSWarpCore implements BãßBȍőnEnumInstanceʸᴰ<TOSWarpCore>,BãßBȍőnEnumJmxʸᴰ<TOSWarpCore,MBeanStoreKeyᴶᴹˣ> {
public enum TOSWarpCore implements DefaultEnumInstanceᴶᴹˣ<TOSWarpCore,MBeanStoreKeyᴶᴹˣ> {
INSTANCE;
private final BãßBȍőnCoffinOpenʸᴰ<MBeanStoreKeyᴶᴹˣ> BBC = BãßBȍőnCoffinOpenʸᴰ.newInstance();
public BãßBȍőnCoffinʸᴰ<MBeanStoreKeyᴶᴹˣ> GET_BBC() { return BBC; }
private final BooleanAttributeᴶᴹˣ armedWarpCipherLock;
private final StringAttributeᴶᴹˣ armedWarpWaterName;
private final StringAttributeᴶᴹˣ armedWarpWaterDesc;
private final GuageCounterᴶᴹˣ warpCoreReads;
private final GuageCounterᴶᴹˣ warpCoreWrites;
private final BãßBȍőnCoffinOpenʸᴰ<MBeanStoreKeyᴶᴹˣ> BBC = BãßBȍőnCoffinOpenʸᴰ.newInstance();
public BãßBȍőnCoffinʸᴰ<MBeanStoreKeyᴶᴹˣ> GET_BBC() { return BBC; }
private TOSWarpCore() {
BBC.BOON_INIT(this);