Converted to BassBone model

This commit is contained in:
Willem Cazander 2022-02-01 18:31:51 +01:00
parent efc2bc74a2
commit 01a37a1496
49 changed files with 376 additions and 563 deletions

View file

@ -55,11 +55,11 @@ public class GroßGetậl6ˢᴰ implements BaseNumberTyte<GroßGetậl6ˢᴰ> {
@Override @Override
public void fillOctalsByClone(T08PartOctalBaseAppender appender) { public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T12PartUncial.forEach(v -> getValue(v).fillOctalsByClone(appender)); T12PartUncial.PART_1.staticVoorElk(v -> getValue(v).fillOctalsByClone(appender));
} }
@Override @Override
public void fillTytesByReference(V009TyteBaseAppender appender) { public void fillTytesByReference(V009TyteBaseAppender appender) {
T12PartUncial.forEach(v -> getValue(v).fillTytesByReference(appender)); T12PartUncial.PART_1.staticVoorElk(v -> getValue(v).fillTytesByReference(appender));
} }
} }

View file

@ -53,11 +53,11 @@ public class KlompGetậl4ˢᴰ implements BaseNumberTyte<KlompGetậl4ˢᴰ> {
@Override @Override
public void fillOctalsByClone(T08PartOctalBaseAppender appender) { public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T08PartOctal.forEach(v -> getValue(v).fillOctalsByClone(appender)); T08PartOctal.PART_1.staticVoorElk(v -> getValue(v).fillOctalsByClone(appender));
} }
@Override @Override
public void fillTytesByReference(V009TyteBaseAppender appender) { public void fillTytesByReference(V009TyteBaseAppender appender) {
T08PartOctal.forEach(v -> getValue(v).fillTytesByReference(appender)); T08PartOctal.PART_1.staticVoorElk(v -> getValue(v).fillTytesByReference(appender));
} }
} }

View file

@ -63,7 +63,7 @@ public class Base2Terminator {
private List<T08PartOctal> base2ReadOctals(int...values) { private List<T08PartOctal> base2ReadOctals(int...values) {
List<T08PartOctal> octals = new ArrayList<>(); List<T08PartOctal> octals = new ArrayList<>();
for (int value:values) { for (int value:values) {
T08PartOctal.forEach(v -> octals.add(T08PartOctal.indexOf(v, value))); T08PartOctal.PART_1.staticVoorElk(v -> octals.add(T08PartOctal.indexOf(v, value)));
} }
return octals; return octals;
} }

View file

@ -1,11 +1,5 @@
package love.distributedrebirth.numberxd.base2t; package love.distributedrebirth.numberxd.base2t;
import java.util.Arrays;
import java.util.Collections;
import java.util.Map;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import love.distributedrebirth.numberxd.base2t.bone.BassBone; import love.distributedrebirth.numberxd.base2t.bone.BassBone;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneCoffin; import love.distributedrebirth.numberxd.base2t.bone.BassBoneCoffin;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneName; import love.distributedrebirth.numberxd.base2t.bone.BassBoneName;
@ -17,7 +11,7 @@ import love.distributedrebirth.numberxd.base2t.bone.BassBoneStoreKey;
* @author willemtsade ©Δ 仙上主天 * @author willemtsade ©Δ 仙上主天
*/ */
@BassBoneName("T02PartBinary") @BassBoneName("T02PartBinary")
public enum T02PartBinary implements BassBone { public enum T02PartBinary implements BassBone<T02PartBinary> {
PART_1("˧","0", "", "low"), PART_1("˧","0", "", "low"),
PART_2("","1", "", "high"), PART_2("","1", "", "high"),
@ -25,34 +19,18 @@ public enum T02PartBinary implements BassBone {
public static int LENGTH() { return values().length; }; public static int LENGTH() { return values().length; };
private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); private final BassBoneCoffin bbc = BassBoneCoffin.newInstance();
private static final Map<String, T02PartBinary> TONE_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v)));
private static final Map<String, T02PartBinary> CHINA_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getChinaKey(), v -> v)));
private T02PartBinary(String idTone, String idLetter, String chinaKey, String chinaValue) { private T02PartBinary(String idTone, String idLetter, String chinaKey, String chinaValue) {
this.getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone);
this.getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter);
this.getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey);
this.getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue);
getBBC().getMapObject(BassBoneStoreKey.MAP_TONE);
getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA);
} }
@Override @Override
public BassBoneCoffin getBBC() { public BassBoneCoffin getBBC() {
return bbc; return bbc;
} }
public static void forEach(Consumer<T02PartBinary> consumer) {
for (T02PartBinary value:values()) {
consumer.accept(value);
}
}
public static T02PartBinary valueOfTone(String identifierTone) {
return TONE_MAP.get(identifierTone);
}
public static T02PartBinary valueOfChina(String chinaKey) {
return CHINA_MAP.get(chinaKey);
}
} }

View file

@ -1,11 +1,5 @@
package love.distributedrebirth.numberxd.base2t; package love.distributedrebirth.numberxd.base2t;
import java.util.Arrays;
import java.util.Collections;
import java.util.Map;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import love.distributedrebirth.numberxd.base2t.bone.BassBone; import love.distributedrebirth.numberxd.base2t.bone.BassBone;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneCoffin; import love.distributedrebirth.numberxd.base2t.bone.BassBoneCoffin;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneName; import love.distributedrebirth.numberxd.base2t.bone.BassBoneName;
@ -17,7 +11,7 @@ import love.distributedrebirth.numberxd.base2t.bone.BassBoneStoreKey;
* @author willemtsade ©Δ 仙上主天 * @author willemtsade ©Δ 仙上主天
*/ */
@BassBoneName("T03PartTrit") @BassBoneName("T03PartTrit")
public enum T03PartTrit implements BassBone { public enum T03PartTrit implements BassBone<T03PartTrit> {
PART_1("˦","0","","1"), PART_1("˦","0","","1"),
PART_2("˧","1","","2"), PART_2("˧","1","","2"),
@ -26,34 +20,18 @@ public enum T03PartTrit implements BassBone {
public static int LENGTH() { return values().length; }; public static int LENGTH() { return values().length; };
private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); private final BassBoneCoffin bbc = BassBoneCoffin.newInstance();
private static final Map<String, T03PartTrit> TONE_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v)));
private static final Map<String, T03PartTrit> CHINA_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getChinaKey(), v -> v)));
private T03PartTrit(String idTone, String idLetter, String chinaKey, String chinaValue) { private T03PartTrit(String idTone, String idLetter, String chinaKey, String chinaValue) {
this.getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone);
this.getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter);
this.getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey);
this.getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue);
getBBC().getMapObject(BassBoneStoreKey.MAP_TONE);
getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA);
} }
@Override @Override
public BassBoneCoffin getBBC() { public BassBoneCoffin getBBC() {
return bbc; return bbc;
} }
public static void forEach(Consumer<T03PartTrit> consumer) {
for (T03PartTrit value:values()) {
consumer.accept(value);
}
}
public static T03PartTrit valueOfTone(String identifierTone) {
return TONE_MAP.get(identifierTone);
}
public static T03PartTrit valueOfChina(String chinaKey) {
return CHINA_MAP.get(chinaKey);
}
} }

View file

@ -1,13 +1,5 @@
package love.distributedrebirth.numberxd.base2t; package love.distributedrebirth.numberxd.base2t;
import java.util.Arrays;
import java.util.Collections;
import java.util.Map;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import love.distributedrebirth.numberxd.base2t.bone.BasePartSplit4;
import love.distributedrebirth.numberxd.base2t.bone.BassBone;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1Info; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1Info;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneCoffin; import love.distributedrebirth.numberxd.base2t.bone.BassBoneCoffin;
@ -21,7 +13,7 @@ import love.distributedrebirth.numberxd.base2t.bone.BassBoneStoreKey;
*/ */
@BassBoneName("T04PartQuad") @BassBoneName("T04PartQuad")
@BassBoneAlt1Info(name="Cardinal direction", website="https://simple.wikipedia.org/wiki/Cardinal_direction") @BassBoneAlt1Info(name="Cardinal direction", website="https://simple.wikipedia.org/wiki/Cardinal_direction")
public enum T04PartQuad implements BassBone,BassBoneAlt1,BasePartSplit4 { public enum T04PartQuad implements BassBoneAlt1<T04PartQuad> {
PART_1("˥","0","","north","N"), PART_1("˥","0","","north","N"),
PART_2("","1","","east", "E"), PART_2("","1","","east", "E"),
@ -31,17 +23,15 @@ public enum T04PartQuad implements BassBone,BassBoneAlt1,BasePartSplit4 {
public static int LENGTH() { return values().length; }; public static int LENGTH() { return values().length; };
private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); private final BassBoneCoffin bbc = BassBoneCoffin.newInstance();
private static final Map<String, T04PartQuad> TONE_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v)));
private static final Map<String, T04PartQuad> CHINA_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getChinaKey(), v -> v)));
private T04PartQuad(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) { private T04PartQuad(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) {
this.getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone);
this.getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter);
this.getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey);
this.getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue);
this.getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value);
getBBC().getMapObject(BassBoneStoreKey.MAP_TONE);
getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA);
} }
@Override @Override
@ -49,17 +39,7 @@ public enum T04PartQuad implements BassBone,BassBoneAlt1,BasePartSplit4 {
return bbc; return bbc;
} }
public static void forEach(Consumer<T04PartQuad> consumer) { public T02PartBinary splitPartBinary(T02PartBinary part) {
for (T04PartQuad value:values()) { return T02PartBinary.values()[(ordinal() >> part.ordinal()) & 1];
consumer.accept(value);
}
}
public static T04PartQuad valueOfTone(String identifierTone) {
return TONE_MAP.get(identifierTone);
}
public static T04PartQuad valueOfChina(String chinaKey) {
return CHINA_MAP.get(chinaKey);
} }
} }

View file

@ -1,12 +1,5 @@
package love.distributedrebirth.numberxd.base2t; package love.distributedrebirth.numberxd.base2t;
import java.util.Arrays;
import java.util.Collections;
import java.util.Map;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import love.distributedrebirth.numberxd.base2t.bone.BassBone;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1Info; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1Info;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt2; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt2;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt2Info; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt2Info;
@ -22,7 +15,7 @@ import love.distributedrebirth.numberxd.base2t.bone.BassBoneStoreKey;
@BassBoneName("T05PartPental") @BassBoneName("T05PartPental")
@BassBoneAlt1Info(name="Pentagram", website="https://en.wikipedia.org/wiki/Pentagram") @BassBoneAlt1Info(name="Pentagram", website="https://en.wikipedia.org/wiki/Pentagram")
@BassBoneAlt2Info(name="Pythagorean Interpretations", website="http://wisdomofhypatia.com/OM/BA/PP.html") @BassBoneAlt2Info(name="Pythagorean Interpretations", website="http://wisdomofhypatia.com/OM/BA/PP.html")
public enum T05PartPental implements BassBone,BassBoneAlt2 { public enum T05PartPental implements BassBoneAlt2<T05PartPental> {
PART_1("˥","0","","fire", "EI","heile"), PART_1("˥","0","","fire", "EI","heile"),
PART_2("˦","1","","water","U", "hudor"), PART_2("˦","1","","water","U", "hudor"),
@ -33,36 +26,20 @@ public enum T05PartPental implements BassBone,BassBoneAlt2 {
public static int LENGTH() { return values().length; }; public static int LENGTH() { return values().length; };
private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); private final BassBoneCoffin bbc = BassBoneCoffin.newInstance();
private static final Map<String, T05PartPental> TONE_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v)));
private static final Map<String, T05PartPental> CHINA_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getChinaKey(), v -> v)));
private T05PartPental(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value, String alt2Value) { private T05PartPental(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value, String alt2Value) {
this.getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone);
this.getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter);
this.getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey);
this.getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue);
this.getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value);
this.getBBC().putInit(BassBoneStoreKey.ALT_2_VALUE, alt2Value); getBBC().putInit(BassBoneStoreKey.ALT_2_VALUE, alt2Value);
getBBC().getMapObject(BassBoneStoreKey.MAP_TONE);
getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA);
} }
@Override @Override
public BassBoneCoffin getBBC() { public BassBoneCoffin getBBC() {
return bbc; return bbc;
} }
public static void forEach(Consumer<T05PartPental> consumer) {
for (T05PartPental value:values()) {
consumer.accept(value);
}
}
public static T05PartPental valueOfTone(String identifierTone) {
return TONE_MAP.get(identifierTone);
}
public static T05PartPental valueOfChina(String chinaKey) {
return CHINA_MAP.get(chinaKey);
}
} }

View file

@ -1,13 +1,5 @@
package love.distributedrebirth.numberxd.base2t; package love.distributedrebirth.numberxd.base2t;
import java.util.Arrays;
import java.util.Collections;
import java.util.Map;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import love.distributedrebirth.numberxd.base2t.bone.BasePartSplit6;
import love.distributedrebirth.numberxd.base2t.bone.BassBone;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1Info; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1Info;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneCoffin; import love.distributedrebirth.numberxd.base2t.bone.BassBoneCoffin;
@ -23,7 +15,7 @@ import love.distributedrebirth.numberxd.base2t.bone.BassBoneStoreKey;
*/ */
@BassBoneName("T06PartSeximal") @BassBoneName("T06PartSeximal")
@BassBoneAlt1Info(name="ADFGVX cipher", website="https://en.wikipedia.org/wiki/ADFGVX_cipher") @BassBoneAlt1Info(name="ADFGVX cipher", website="https://en.wikipedia.org/wiki/ADFGVX_cipher")
public enum T06PartSeximal implements BassBone,BassBoneAlt1,BasePartSplit6 { public enum T06PartSeximal implements BassBoneAlt1<T06PartSeximal> {
PART_1("˦","0","","4","A"), PART_1("˦","0","","4","A"),
PART_2("˨","1","","5","D"), PART_2("˨","1","","5","D"),
@ -35,17 +27,15 @@ public enum T06PartSeximal implements BassBone,BassBoneAlt1,BasePartSplit6 {
public static int LENGTH() { return values().length; }; public static int LENGTH() { return values().length; };
private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); private final BassBoneCoffin bbc = BassBoneCoffin.newInstance();
private static final Map<String, T06PartSeximal> TONE_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v)));
private static final Map<String, T06PartSeximal> CHINA_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getChinaKey(), v -> v)));
private T06PartSeximal(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) { private T06PartSeximal(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) {
this.getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone);
this.getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter);
this.getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey);
this.getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue);
this.getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value);
getBBC().getMapObject(BassBoneStoreKey.MAP_TONE);
getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA);
} }
@Override @Override
@ -53,17 +43,11 @@ public enum T06PartSeximal implements BassBone,BassBoneAlt1,BasePartSplit6 {
return bbc; return bbc;
} }
public static void forEach(Consumer<T06PartSeximal> consumer) { public T02PartBinary splitPartBinary() {
for (T06PartSeximal value:values()) { return T02PartBinary.values()[ordinal() & 1];
consumer.accept(value);
}
} }
public static T06PartSeximal valueOfTone(String identifierTone) { public T03PartTrit splitPartTrit() {
return TONE_MAP.get(identifierTone); return T03PartTrit.values()[ordinal() >> 1];
}
public static T06PartSeximal valueOfChina(String chinaKey) {
return CHINA_MAP.get(chinaKey);
} }
} }

View file

@ -1,12 +1,5 @@
package love.distributedrebirth.numberxd.base2t; package love.distributedrebirth.numberxd.base2t;
import java.util.Arrays;
import java.util.Collections;
import java.util.Map;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import love.distributedrebirth.numberxd.base2t.bone.BassBone;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1Info; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1Info;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneCoffin; import love.distributedrebirth.numberxd.base2t.bone.BassBoneCoffin;
@ -20,7 +13,7 @@ import love.distributedrebirth.numberxd.base2t.bone.BassBoneStoreKey;
*/ */
@BassBoneName("T07PartPlanIt") @BassBoneName("T07PartPlanIt")
@BassBoneAlt1Info(name="Fallen sign", website="https://en.wikipedia.org/wiki/Classical_planet#Western_astrology") @BassBoneAlt1Info(name="Fallen sign", website="https://en.wikipedia.org/wiki/Classical_planet#Western_astrology")
public enum T07PartPlanIt implements BassBone,BassBoneAlt1 { public enum T07PartPlanIt implements BassBoneAlt1<T07PartPlanIt> {
PART_1("˥","0","♎︎","libra","天秤座"), PART_1("˥","0","♎︎","libra","天秤座"),
PART_2("","1","♏︎","scorpio","天蠍座"), PART_2("","1","♏︎","scorpio","天蠍座"),
@ -33,35 +26,19 @@ public enum T07PartPlanIt implements BassBone,BassBoneAlt1 {
public static int LENGTH() { return values().length; }; public static int LENGTH() { return values().length; };
private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); private final BassBoneCoffin bbc = BassBoneCoffin.newInstance();
private static final Map<String, T07PartPlanIt> TONE_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v)));
private static final Map<String, T07PartPlanIt> CHINA_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getChinaKey(), v -> v)));
private T07PartPlanIt(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) { private T07PartPlanIt(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) {
this.getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone);
this.getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter);
this.getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey);
this.getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue);
this.getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value);
getBBC().getMapObject(BassBoneStoreKey.MAP_TONE);
getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA);
} }
@Override @Override
public BassBoneCoffin getBBC() { public BassBoneCoffin getBBC() {
return bbc; return bbc;
} }
public static void forEach(Consumer<T07PartPlanIt> consumer) {
for (T07PartPlanIt value:values()) {
consumer.accept(value);
}
}
public static T07PartPlanIt valueOfTone(String identifierTone) {
return TONE_MAP.get(identifierTone);
}
public static T07PartPlanIt valueOfChina(String chinaKey) {
return CHINA_MAP.get(chinaKey);
}
} }

View file

@ -1,13 +1,6 @@
package love.distributedrebirth.numberxd.base2t; package love.distributedrebirth.numberxd.base2t;
import java.util.Arrays; import love.distributedrebirth.numberxd.base2t.bone.BassBoneShiftBits;
import java.util.Collections;
import java.util.Map;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import love.distributedrebirth.numberxd.base2t.bone.BasePartSplit8;
import love.distributedrebirth.numberxd.base2t.bone.BassBone;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1Info; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1Info;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt2; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt2;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt2Info; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt2Info;
@ -23,7 +16,7 @@ import love.distributedrebirth.numberxd.base2t.bone.BassBoneStoreKey;
@BassBoneName("T08PartOctal") @BassBoneName("T08PartOctal")
@BassBoneAlt1Info(name="Absolute Tone Sequence", website="https://en.wikipedia.org/wiki/Tone_letter") @BassBoneAlt1Info(name="Absolute Tone Sequence", website="https://en.wikipedia.org/wiki/Tone_letter")
@BassBoneAlt2Info(name="Relative Tone Sequence", website="https://en.wikipedia.org/wiki/Tone_letter") @BassBoneAlt2Info(name="Relative Tone Sequence", website="https://en.wikipedia.org/wiki/Tone_letter")
public enum T08PartOctal implements BassBone,BassBoneAlt2,BasePartSplit8 { public enum T08PartOctal implements BassBoneAlt2<T08PartOctal>,BassBoneShiftBits<T08PartOctal> {
PART_1("˥","0","","heart","˧˥˩","˥˩˧", 0), PART_1("˥","0","","heart","˧˥˩","˥˩˧", 0),
PART_2("˩","1","","head", "˧˩˥","˩˥˧", 3), PART_2("˩","1","","head", "˧˩˥","˩˥˧", 3),
@ -39,19 +32,17 @@ public enum T08PartOctal implements BassBone,BassBoneAlt2,BasePartSplit8 {
public static int BIT_COUNT = 3; public static int BIT_COUNT = 3;
private static final byte BITMASK = 0x07; private static final byte BITMASK = 0x07;
private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); private final BassBoneCoffin bbc = BassBoneCoffin.newInstance();
private static final Map<String, T08PartOctal> TONE_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v)));
private static final Map<String, T08PartOctal> CHINA_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getChinaKey(), v -> v)));
private T08PartOctal(String identifierTone, String identifierLetter, String chinaKey, String chinaValue, String alt1Value, String alt2Value, int shiftBits) { private T08PartOctal(String identifierTone, String identifierLetter, String chinaKey, String chinaValue, String alt1Value, String alt2Value, int shiftBits) {
this.getBBC().putInit(BassBoneStoreKey.ID_TONE, identifierTone); getBBC().putInit(BassBoneStoreKey.ID_TONE, identifierTone);
this.getBBC().putInit(BassBoneStoreKey.ID_LETTER, identifierLetter); getBBC().putInit(BassBoneStoreKey.ID_LETTER, identifierLetter);
this.getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey);
this.getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue);
this.getBBC().putInit(BassBoneStoreKey.SHIFT_BITS, Integer.valueOf(shiftBits)); getBBC().putInit(BassBoneStoreKey.SHIFT_BITS, Integer.valueOf(shiftBits));
this.getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value);
this.getBBC().putInit(BassBoneStoreKey.ALT_2_VALUE, alt2Value); getBBC().putInit(BassBoneStoreKey.ALT_2_VALUE, alt2Value);
getBBC().getMapObject(BassBoneStoreKey.MAP_TONE);
getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA);
} }
@Override @Override
@ -63,17 +54,11 @@ public enum T08PartOctal implements BassBone,BassBoneAlt2,BasePartSplit8 {
return T08PartOctal.values()[(value >> group.getShiftBits()) & BITMASK]; return T08PartOctal.values()[(value >> group.getShiftBits()) & BITMASK];
} }
public static void forEach(Consumer<T08PartOctal> consumer) { public T02PartBinary splitPartBinary(T03PartTrit part) {
for (T08PartOctal value:values()) { return T02PartBinary.values()[(ordinal() >> part.ordinal()) & 1];
consumer.accept(value);
}
} }
public static T08PartOctal valueOfTone(String identifierTone) { public int ordinalOf(T08PartOctal group) {
return TONE_MAP.get(identifierTone); return ordinal() << group.getShiftBits();
}
public static T08PartOctal valueOfChina(String chinaKey) {
return CHINA_MAP.get(chinaKey);
} }
} }

View file

@ -1,12 +1,5 @@
package love.distributedrebirth.numberxd.base2t; package love.distributedrebirth.numberxd.base2t;
import java.util.Arrays;
import java.util.Collections;
import java.util.Map;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import love.distributedrebirth.numberxd.base2t.bone.BassBone;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1Info; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1Info;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt2Info; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt2Info;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt3Info; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt3Info;
@ -26,7 +19,7 @@ import love.distributedrebirth.numberxd.base2t.bone.BassBoneStoreKey;
@BassBoneAlt2Info(name="Burmese numerals", website="https://en.wikipedia.org/wiki/Burmese_numerals") @BassBoneAlt2Info(name="Burmese numerals", website="https://en.wikipedia.org/wiki/Burmese_numerals")
@BassBoneAlt3Info(name="Bengali numerals", website="https://en.wikipedia.org/wiki/Bengali_numerals") @BassBoneAlt3Info(name="Bengali numerals", website="https://en.wikipedia.org/wiki/Bengali_numerals")
@BassBoneAlt4Info(name="Sinhala Lith Illakkam", website="https://en.wikipedia.org/wiki/Sinhala_numerals#Numerals") @BassBoneAlt4Info(name="Sinhala Lith Illakkam", website="https://en.wikipedia.org/wiki/Sinhala_numerals#Numerals")
public enum T10PartDecimal implements BassBone,BassBoneAlt4 { public enum T10PartDecimal implements BassBoneAlt4<T10PartDecimal> {
PART_1 ("˥","ō","","zero", "","\u1040","", ""), PART_1 ("˥","ō","","zero", "","\u1040","", ""),
PART_2 ("˦","α","","one", "","\u1041","", ""), PART_2 ("˦","α","","one", "","\u1041","", ""),
@ -42,39 +35,23 @@ public enum T10PartDecimal implements BassBone,BassBoneAlt4 {
public static int LENGTH() { return values().length; }; public static int LENGTH() { return values().length; };
private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); private final BassBoneCoffin bbc = BassBoneCoffin.newInstance();
private static final Map<String, T10PartDecimal> TONE_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v)));
private static final Map<String, T10PartDecimal> CHINA_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getChinaKey(), v -> v)));
private T10PartDecimal(String idTone, String idLetter, String chinaKey, String chinaValue, private T10PartDecimal(String idTone, String idLetter, String chinaKey, String chinaValue,
String alt1Value, String alt2Value, String alt3Value, String alt4Value) { String alt1Value, String alt2Value, String alt3Value, String alt4Value) {
this.getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone);
this.getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter);
this.getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey);
this.getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue);
this.getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value);
this.getBBC().putInit(BassBoneStoreKey.ALT_2_VALUE, alt2Value); getBBC().putInit(BassBoneStoreKey.ALT_2_VALUE, alt2Value);
this.getBBC().putInit(BassBoneStoreKey.ALT_3_VALUE, alt3Value); getBBC().putInit(BassBoneStoreKey.ALT_3_VALUE, alt3Value);
this.getBBC().putInit(BassBoneStoreKey.ALT_4_VALUE, alt4Value); getBBC().putInit(BassBoneStoreKey.ALT_4_VALUE, alt4Value);
getBBC().getMapObject(BassBoneStoreKey.MAP_TONE);
getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA);
} }
@Override @Override
public BassBoneCoffin getBBC() { public BassBoneCoffin getBBC() {
return bbc; return bbc;
} }
public static void forEach(Consumer<T10PartDecimal> consumer) {
for (T10PartDecimal value:values()) {
consumer.accept(value);
}
}
public static T10PartDecimal valueOfTone(String identifierTone) {
return TONE_MAP.get(identifierTone);
}
public static T10PartDecimal valueOfChina(String chinaKey) {
return CHINA_MAP.get(chinaKey);
}
} }

View file

@ -1,12 +1,5 @@
package love.distributedrebirth.numberxd.base2t; package love.distributedrebirth.numberxd.base2t;
import java.util.Arrays;
import java.util.Collections;
import java.util.Map;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import love.distributedrebirth.numberxd.base2t.bone.BassBone;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1Info; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1Info;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneCoffin; import love.distributedrebirth.numberxd.base2t.bone.BassBoneCoffin;
@ -20,7 +13,7 @@ import love.distributedrebirth.numberxd.base2t.bone.BassBoneStoreKey;
*/ */
@BassBoneName("T11PartUndecimal") @BassBoneName("T11PartUndecimal")
@BassBoneAlt1Info(name="Tamil numerals", website="https://en.wikipedia.org/wiki/Tamil_numerals") @BassBoneAlt1Info(name="Tamil numerals", website="https://en.wikipedia.org/wiki/Tamil_numerals")
public enum T11PartUndecimal implements BassBone,BassBoneAlt1 { public enum T11PartUndecimal implements BassBoneAlt1<T11PartUndecimal> {
PART_1 ("˥","0","","walk", ""), PART_1 ("˥","0","","walk", ""),
PART_2 ("","1","","run", ""), PART_2 ("","1","","run", ""),
@ -37,35 +30,19 @@ public enum T11PartUndecimal implements BassBone,BassBoneAlt1 {
public static int LENGTH() { return values().length; }; public static int LENGTH() { return values().length; };
private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); private final BassBoneCoffin bbc = BassBoneCoffin.newInstance();
private static final Map<String, T11PartUndecimal> TONE_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v)));
private static final Map<String, T11PartUndecimal> CHINA_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getChinaKey(), v -> v)));
private T11PartUndecimal(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) { private T11PartUndecimal(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) {
this.getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone);
this.getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter);
this.getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey);
this.getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue);
this.getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value);
getBBC().getMapObject(BassBoneStoreKey.MAP_TONE);
getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA);
} }
@Override @Override
public BassBoneCoffin getBBC() { public BassBoneCoffin getBBC() {
return bbc; return bbc;
} }
public static void forEach(Consumer<T11PartUndecimal> consumer) {
for (T11PartUndecimal value:values()) {
consumer.accept(value);
}
}
public static T11PartUndecimal valueOfTone(String identifierTone) {
return TONE_MAP.get(identifierTone);
}
public static T11PartUndecimal valueOfChina(String chinaKey) {
return CHINA_MAP.get(chinaKey);
}
} }

View file

@ -1,12 +1,5 @@
package love.distributedrebirth.numberxd.base2t; package love.distributedrebirth.numberxd.base2t;
import java.util.Arrays;
import java.util.Collections;
import java.util.Map;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import love.distributedrebirth.numberxd.base2t.bone.BassBone;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1Info; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1Info;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneCoffin; import love.distributedrebirth.numberxd.base2t.bone.BassBoneCoffin;
@ -20,7 +13,7 @@ import love.distributedrebirth.numberxd.base2t.bone.BassBoneStoreKey;
*/ */
@BassBoneName("T12PartUncial") @BassBoneName("T12PartUncial")
@BassBoneAlt1Info(name="Transdecimal symbols", website="https://en.wikipedia.org/wiki/Duodecimal#Transdecimal_symbols") @BassBoneAlt1Info(name="Transdecimal symbols", website="https://en.wikipedia.org/wiki/Duodecimal#Transdecimal_symbols")
public enum T12PartUncial implements BassBone,BassBoneAlt1 { public enum T12PartUncial implements BassBoneAlt1<T12PartUncial> {
PART_1 ("˥","0","","sun", "0"), PART_1 ("˥","0","","sun", "0"),
PART_2 ("˧","1","","moon", "1"), PART_2 ("˧","1","","moon", "1"),
@ -38,35 +31,19 @@ public enum T12PartUncial implements BassBone,BassBoneAlt1 {
public static int LENGTH() { return values().length; }; public static int LENGTH() { return values().length; };
private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); private final BassBoneCoffin bbc = BassBoneCoffin.newInstance();
private static final Map<String, T12PartUncial> TONE_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v)));
private static final Map<String, T12PartUncial> CHINA_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getChinaKey(), v -> v)));
private T12PartUncial(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) { private T12PartUncial(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) {
this.getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone);
this.getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter);
this.getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey);
this.getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue);
this.getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value);
getBBC().getMapObject(BassBoneStoreKey.MAP_TONE);
getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA);
} }
@Override @Override
public BassBoneCoffin getBBC() { public BassBoneCoffin getBBC() {
return bbc; return bbc;
} }
public static void forEach(Consumer<T12PartUncial> consumer) {
for (T12PartUncial value:values()) {
consumer.accept(value);
}
}
public static T12PartUncial valueOfTone(String identifierTone) {
return TONE_MAP.get(identifierTone);
}
public static T12PartUncial valueOfChina(String chinaKey) {
return CHINA_MAP.get(chinaKey);
}
} }

View file

@ -1,13 +1,5 @@
package love.distributedrebirth.numberxd.base2t; package love.distributedrebirth.numberxd.base2t;
import java.util.Arrays;
import java.util.Collections;
import java.util.Map;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import love.distributedrebirth.numberxd.base2t.bone.BasePartSplit16;
import love.distributedrebirth.numberxd.base2t.bone.BassBone;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1Info; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1Info;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneCoffin; import love.distributedrebirth.numberxd.base2t.bone.BassBoneCoffin;
@ -21,7 +13,7 @@ import love.distributedrebirth.numberxd.base2t.bone.BassBoneStoreKey;
*/ */
@BassBoneName("T16PartHex") @BassBoneName("T16PartHex")
@BassBoneAlt1Info(name="Dual-tone multi-frequency signaling", website="https://en.wikipedia.org/wiki/Dual-tone_multi-frequency_signaling") @BassBoneAlt1Info(name="Dual-tone multi-frequency signaling", website="https://en.wikipedia.org/wiki/Dual-tone_multi-frequency_signaling")
public enum T16PartHex implements BassBone,BassBoneAlt1,BasePartSplit16 { public enum T16PartHex implements BassBoneAlt1<T16PartHex> {
PART_1 ("˥","0","","hydrogen", "1"), PART_1 ("˥","0","","hydrogen", "1"),
PART_2 ("˦","1","","helium", "2"), PART_2 ("˦","1","","helium", "2"),
@ -43,17 +35,15 @@ public enum T16PartHex implements BassBone,BassBoneAlt1,BasePartSplit16 {
public static int LENGTH() { return values().length; }; public static int LENGTH() { return values().length; };
private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); private final BassBoneCoffin bbc = BassBoneCoffin.newInstance();
private static final Map<String, T16PartHex> TONE_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v)));
private static final Map<String, T16PartHex> CHINA_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getChinaKey(), v -> v)));
private T16PartHex(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) { private T16PartHex(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) {
this.getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone);
this.getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter);
this.getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey);
this.getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue);
this.getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value);
getBBC().getMapObject(BassBoneStoreKey.MAP_TONE);
getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA);
} }
@Override @Override
@ -61,17 +51,7 @@ public enum T16PartHex implements BassBone,BassBoneAlt1,BasePartSplit16 {
return bbc; return bbc;
} }
public static void forEach(Consumer<T16PartHex> consumer) { public T02PartBinary splitPartBinary(T04PartQuad part) {
for (T16PartHex value:values()) { return T02PartBinary.values()[(ordinal() >> part.ordinal()) & 1];
consumer.accept(value);
}
}
public static T16PartHex valueOfTone(String identifierTone) {
return TONE_MAP.get(identifierTone);
}
public static T16PartHex valueOfChina(String chinaKey) {
return CHINA_MAP.get(chinaKey);
} }
} }

View file

@ -3,10 +3,8 @@ package love.distributedrebirth.numberxd.base2t;
import java.util.Arrays; import java.util.Arrays;
import java.util.Collections; import java.util.Collections;
import java.util.Map; import java.util.Map;
import java.util.function.Consumer;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import love.distributedrebirth.numberxd.base2t.bone.BassBone;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1Info; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1Info;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt2Info; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt2Info;
import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt3; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt3;
@ -24,7 +22,7 @@ import love.distributedrebirth.numberxd.base2t.bone.BassBoneStoreKey;
@BassBoneAlt1Info(name="Vigesimal", website="https://en.wikipedia.org/wiki/Vigesimal#Places") @BassBoneAlt1Info(name="Vigesimal", website="https://en.wikipedia.org/wiki/Vigesimal#Places")
@BassBoneAlt2Info(name="Vigesimal Alternative", website="https://en.wikipedia.org/wiki/Vigesimal#Places") @BassBoneAlt2Info(name="Vigesimal Alternative", website="https://en.wikipedia.org/wiki/Vigesimal#Places")
@BassBoneAlt3Info(name="Open Location Code", website="https://en.wikipedia.org/wiki/Open_Location_Code") @BassBoneAlt3Info(name="Open Location Code", website="https://en.wikipedia.org/wiki/Open_Location_Code")
public enum T20PartScore implements BassBone,BassBoneAlt3 { public enum T20PartScore implements BassBoneAlt3<T20PartScore> {
PART_1 ("˥","Y", "","yotta","0","0","2"), PART_1 ("˥","Y", "","yotta","0","0","2"),
PART_2 ("˦","Z", "","zetta","1","1","3"), PART_2 ("˦","Z", "","zetta","1","1","3"),
@ -50,22 +48,20 @@ public enum T20PartScore implements BassBone,BassBoneAlt3 {
public static int LENGTH() { return values().length; }; public static int LENGTH() { return values().length; };
private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); private final BassBoneCoffin bbc = BassBoneCoffin.newInstance();
private static final Map<String, T20PartScore> TONE_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v)));
private static final Map<String, T20PartScore> CHINA_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getChinaKey(), v -> v)));
private static final Map<String, T20PartScore> OPENLC_MAP = Collections.unmodifiableMap( private static final Map<String, T20PartScore> OPENLC_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getAlt3Value(), v -> v))); Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getAlt3Value(), v -> v)));
private T20PartScore(String idTone, String idLetter, String chinaKey, String chinaValue, private T20PartScore(String idTone, String idLetter, String chinaKey, String chinaValue,
String alt1Value, String alt2Value, String alt3Value) { String alt1Value, String alt2Value, String alt3Value) {
this.getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone);
this.getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter);
this.getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey);
this.getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue);
this.getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value);
this.getBBC().putInit(BassBoneStoreKey.ALT_2_VALUE, alt2Value); getBBC().putInit(BassBoneStoreKey.ALT_2_VALUE, alt2Value);
this.getBBC().putInit(BassBoneStoreKey.ALT_3_VALUE, alt3Value); getBBC().putInit(BassBoneStoreKey.ALT_3_VALUE, alt3Value);
getBBC().getMapObject(BassBoneStoreKey.MAP_TONE);
getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA);
} }
@Override @Override
@ -73,21 +69,7 @@ public enum T20PartScore implements BassBone,BassBoneAlt3 {
return bbc; return bbc;
} }
public static void forEach(Consumer<T20PartScore> consumer) { public T20PartScore staticValueOfOpenLC(String openLCKey) {
for (T20PartScore value:values()) {
consumer.accept(value);
}
}
public static T20PartScore valueOfTone(String identifierTone) {
return TONE_MAP.get(identifierTone);
}
public static T20PartScore valueOfChina(String chinaKey) {
return CHINA_MAP.get(chinaKey);
}
public static T20PartScore valueOfOpenLC(String openLCKey) {
return OPENLC_MAP.get(openLCKey); return OPENLC_MAP.get(openLCKey);
} }
} }

View file

@ -43,6 +43,6 @@ public final class V006Tixte implements BaseNumber<V006Tixte> {
@Override @Override
public void fillOctalsByClone(T08PartOctalBaseAppender appender) { public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillOctalsByClone(appender)); T02PartBinary.PART_1.staticVoorElk(v -> getValue(v).fillOctalsByClone(appender));
} }
} }

View file

@ -44,7 +44,7 @@ public final class V009Tyte implements BaseNumberTyte<V009Tyte> {
@Override @Override
public void fillOctalsByClone(T08PartOctalBaseAppender appender) { public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T03PartTrit.forEach(v -> getValue(v).fillOctalsByClone(appender)); T03PartTrit.PART_1.staticVoorElk(v -> getValue(v).fillOctalsByClone(appender));
} }
@Override @Override

View file

@ -51,11 +51,11 @@ public final class V012Tord implements BaseNumberTyte<V012Tord> {
@Override @Override
public void fillOctalsByClone(T08PartOctalBaseAppender appender) { public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillOctalsByClone(appender)); T02PartBinary.PART_1.staticVoorElk(v -> getValue(v).fillOctalsByClone(appender));
} }
@Override @Override
public void fillTytesByReference(V009TyteBaseAppender appender) { public void fillTytesByReference(V009TyteBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillTytesByReference(appender)); T02PartBinary.PART_1.staticVoorElk(v -> getValue(v).fillTytesByReference(appender));
} }
} }

View file

@ -48,11 +48,11 @@ public final class V01BTemvig implements BaseNumberTyte<V01BTemvig> {
@Override @Override
public void fillOctalsByClone(T08PartOctalBaseAppender appender) { public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T03PartTrit.forEach(v -> getValue(v).fillOctalsByClone(appender)); T03PartTrit.PART_1.staticVoorElk(v -> getValue(v).fillOctalsByClone(appender));
} }
@Override @Override
public void fillTytesByReference(V009TyteBaseAppender appender) { public void fillTytesByReference(V009TyteBaseAppender appender) {
T03PartTrit.forEach(v -> getValue(v).fillTytesByReference(appender)); T03PartTrit.PART_1.staticVoorElk(v -> getValue(v).fillTytesByReference(appender));
} }
} }

View file

@ -57,11 +57,11 @@ public final class V024Teger implements BaseNumberTyte<V024Teger> {
@Override @Override
public void fillOctalsByClone(T08PartOctalBaseAppender appender) { public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillOctalsByClone(appender)); T02PartBinary.PART_1.staticVoorElk(v -> getValue(v).fillOctalsByClone(appender));
} }
@Override @Override
public void fillTytesByReference(V009TyteBaseAppender appender) { public void fillTytesByReference(V009TyteBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillTytesByReference(appender)); T02PartBinary.PART_1.staticVoorElk(v -> getValue(v).fillTytesByReference(appender));
} }
} }

View file

@ -42,6 +42,6 @@ public final class V02ATraw implements BaseNumber<V02ATraw> {
@Override @Override
public void fillOctalsByClone(T08PartOctalBaseAppender appender) { public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T07PartPlanIt.forEach(v -> getValue(v).fillOctalsByClone(appender)); T07PartPlanIt.PART_1.staticVoorElk(v -> getValue(v).fillOctalsByClone(appender));
} }
} }

View file

@ -59,11 +59,11 @@ public final class V048Tong implements BaseNumberTyte<V048Tong> {
@Override @Override
public void fillOctalsByClone(T08PartOctalBaseAppender appender) { public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillOctalsByClone(appender)); T02PartBinary.PART_1.staticVoorElk(v -> getValue(v).fillOctalsByClone(appender));
} }
@Override @Override
public void fillTytesByReference(V009TyteBaseAppender appender) { public void fillTytesByReference(V009TyteBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillTytesByReference(appender)); T02PartBinary.PART_1.staticVoorElk(v -> getValue(v).fillTytesByReference(appender));
} }
} }

View file

@ -73,11 +73,11 @@ public final class V090Tocta implements BaseNumberTyte<V090Tocta> {
@Override @Override
public void fillOctalsByClone(T08PartOctalBaseAppender appender) { public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillOctalsByClone(appender)); T02PartBinary.PART_1.staticVoorElk(v -> getValue(v).fillOctalsByClone(appender));
} }
@Override @Override
public void fillTytesByReference(V009TyteBaseAppender appender) { public void fillTytesByReference(V009TyteBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillTytesByReference(appender)); T02PartBinary.PART_1.staticVoorElk(v -> getValue(v).fillTytesByReference(appender));
} }
} }

View file

@ -43,11 +43,11 @@ public class VCA8Tath implements BaseNumberTyte<VCA8Tath> {
@Override @Override
public void fillOctalsByClone(T08PartOctalBaseAppender appender) { public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillOctalsByClone(appender)); T02PartBinary.PART_1.staticVoorElk(v -> getValue(v).fillOctalsByClone(appender));
} }
@Override @Override
public void fillTytesByReference(V009TyteBaseAppender appender) { public void fillTytesByReference(V009TyteBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillTytesByReference(appender)); T02PartBinary.PART_1.staticVoorElk(v -> getValue(v).fillTytesByReference(appender));
} }
} }

View file

@ -1,16 +0,0 @@
package love.distributedrebirth.numberxd.base2t.bone;
import love.distributedrebirth.numberxd.base2t.T02PartBinary;
import love.distributedrebirth.numberxd.base2t.T04PartQuad;
/**
*
*
* @author willemtsade ©Δ 仙上主天
*/
public interface BasePartSplit16 extends BassBone {
default T02PartBinary splitPartBinary(T04PartQuad part) {
return T02PartBinary.values()[(ordinal() >> part.ordinal()) & 1];
}
}

View file

@ -1,15 +0,0 @@
package love.distributedrebirth.numberxd.base2t.bone;
import love.distributedrebirth.numberxd.base2t.T02PartBinary;
/**
*
*
* @author willemtsade ©Δ 仙上主天
*/
public interface BasePartSplit4 extends BassBone {
default T02PartBinary splitPartBinary(T02PartBinary part) {
return T02PartBinary.values()[(ordinal() >> part.ordinal()) & 1];
}
}

View file

@ -1,20 +0,0 @@
package love.distributedrebirth.numberxd.base2t.bone;
import love.distributedrebirth.numberxd.base2t.T02PartBinary;
import love.distributedrebirth.numberxd.base2t.T03PartTrit;
/**
*
*
* @author willemtsade ©Δ 仙上主天
*/
public interface BasePartSplit6 extends BassBone {
default T02PartBinary splitPartBinary() {
return T02PartBinary.values()[ordinal() & 1];
}
default T03PartTrit splitPartTrit() {
return T03PartTrit.values()[ordinal() >> 1];
}
}

View file

@ -1,21 +0,0 @@
package love.distributedrebirth.numberxd.base2t.bone;
import love.distributedrebirth.numberxd.base2t.T02PartBinary;
import love.distributedrebirth.numberxd.base2t.T03PartTrit;
import love.distributedrebirth.numberxd.base2t.T08PartOctal;
/**
*
*
* @author willemtsade ©Δ 仙上主天
*/
public interface BasePartSplit8 extends BasePartShiftBits {
default T02PartBinary splitPartBinary(T03PartTrit part) {
return T02PartBinary.values()[(ordinal() >> part.ordinal()) & 1];
}
default int ordinalOf(T08PartOctal group) {
return ordinal() << group.getShiftBits();
}
}

View file

@ -1,17 +1,16 @@
package love.distributedrebirth.numberxd.base2t.bone; package love.distributedrebirth.numberxd.base2t.bone;
import java.util.Map;
import java.util.stream.Collectors;
/** /**
* *
* *
* @author willemtsade ©Δ 仙上主天 * @author willemtsade ©Δ 仙上主天
*/ */
public interface BassBone extends BassBoneStore { public interface BassBone<T extends BassBone<T>> extends BassBoneEnum<T>, BassBoneStore {
String name(); default String staticBoneNaam() {
int ordinal();
default String staticBoneName() {
return getClass().getAnnotation(BassBoneName.class).value(); return getClass().getAnnotation(BassBoneName.class).value();
} }
@ -30,4 +29,22 @@ public interface BassBone extends BassBoneStore {
default String getChinaValue() { default String getChinaValue() {
return getBBC().getString(BassBoneStoreKey.CHINA_VALUE); return getBBC().getString(BassBoneStoreKey.CHINA_VALUE);
} }
@SuppressWarnings("unchecked")
default T staticValueOfTone(String identifierTone) {
Map<String,Object> mapTone = getBBC().getMapObject(BassBoneStoreKey.MAP_TONE);
if (mapTone.isEmpty()) {
mapTone.putAll(staticInstancesStream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v)));
}
return (T) mapTone.get(identifierTone);
}
@SuppressWarnings("unchecked")
default T staticValueOfChina(String chinaKey) {
Map<String,Object> mapChina = getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA);
if (mapChina.isEmpty()) {
mapChina.putAll(staticInstancesStream().collect(Collectors.toMap(v -> v.getChinaKey(), v -> v)));
}
return (T) mapChina.get(chinaKey);
}
} }

View file

@ -5,7 +5,7 @@ package love.distributedrebirth.numberxd.base2t.bone;
* *
* @author willemtsade ©Δ 仙上主天 * @author willemtsade ©Δ 仙上主天
*/ */
public interface BassBoneAlt1 extends BassBone { public interface BassBoneAlt1<T extends BassBone<T>> extends BassBone<T> {
default String getAlt1Value() { default String getAlt1Value() {
return getBBC().getString(BassBoneStoreKey.ALT_1_VALUE); return getBBC().getString(BassBoneStoreKey.ALT_1_VALUE);

View file

@ -5,7 +5,7 @@ package love.distributedrebirth.numberxd.base2t.bone;
* *
* @author willemtsade ©Δ 仙上主天 * @author willemtsade ©Δ 仙上主天
*/ */
public interface BassBoneAlt2 extends BassBoneAlt1 { public interface BassBoneAlt2<T extends BassBone<T>> extends BassBoneAlt1<T> {
default String getAlt2Value() { default String getAlt2Value() {
return getBBC().getString(BassBoneStoreKey.ALT_2_VALUE); return getBBC().getString(BassBoneStoreKey.ALT_2_VALUE);

View file

@ -5,7 +5,7 @@ package love.distributedrebirth.numberxd.base2t.bone;
* *
* @author willemtsade ©Δ 仙上主天 * @author willemtsade ©Δ 仙上主天
*/ */
public interface BassBoneAlt3 extends BassBoneAlt2 { public interface BassBoneAlt3<T extends BassBone<T>> extends BassBoneAlt2<T> {
default String getAlt3Value() { default String getAlt3Value() {
return getBBC().getString(BassBoneStoreKey.ALT_3_VALUE); return getBBC().getString(BassBoneStoreKey.ALT_3_VALUE);

View file

@ -5,7 +5,7 @@ package love.distributedrebirth.numberxd.base2t.bone;
* *
* @author willemtsade ©Δ 仙上主天 * @author willemtsade ©Δ 仙上主天
*/ */
public interface BassBoneAlt4 extends BassBoneAlt3 { public interface BassBoneAlt4<T extends BassBone<T>> extends BassBoneAlt3<T> {
default String getAlt4Value() { default String getAlt4Value() {
return getBBC().getString(BassBoneStoreKey.ALT_4_VALUE); return getBBC().getString(BassBoneStoreKey.ALT_4_VALUE);

View file

@ -25,6 +25,22 @@ public interface BassBoneCoffin {
return Boolean.class.cast(get(key)); return Boolean.class.cast(get(key));
} }
@SuppressWarnings("unchecked")
default Map<String,Object> getMapObject(BassBoneStoreKey key) {
if (get(key) == null) {
putInit(key, new HashMap<>());
}
return Map.class.cast(get(key));
}
@SuppressWarnings("unchecked")
default Map<String,String> getMapString(BassBoneStoreKey key) {
if (get(key) == null) {
putInit(key, new HashMap<>());
}
return Map.class.cast(get(key));
}
static BassBoneCoffin newInstance() { static BassBoneCoffin newInstance() {
return new BassBoneCoffin() { return new BassBoneCoffin() {
final Map<BassBoneStoreKey,Object> initMap = new HashMap<>(); final Map<BassBoneStoreKey,Object> initMap = new HashMap<>();

View file

@ -0,0 +1,81 @@
package love.distributedrebirth.numberxd.base2t.bone;
import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.function.Consumer;
import java.util.stream.Stream;
/**
*
*
* @author willemtsade ©Δ 仙上主天
*/
public interface BassBoneEnum<T> {
int ordinal();
String name();
default String naam() {
return name(); // Deutsche code
}
@SuppressWarnings("unchecked")
default T[] staticInstances() {
try {
Object result = getClass().getMethod("values").invoke(null);
return (T[]) result;
} catch (Exception e) {
throw new RuntimeException(e);
}
}
default List<T> staticInstancesList() {
return Arrays.asList(staticInstances());
}
default Iterator<T> staticInstancesIterator() {
return staticInstancesList().iterator();
}
default Stream<T> staticInstancesStream() {
return staticInstancesList().stream();
}
default T volgende() {
T[] values = staticInstances();
int resultIndex = 0;
for (int i=0;i<values.length;i++) {
if (this == values[i]) {
resultIndex = i + 1;
break;
}
}
if (resultIndex == values.length) {
resultIndex = 0;
}
return values[resultIndex];
}
default T vorige() {
T[] values = staticInstances();
int resultIndex = 0;
for (int i=0;i<values.length;i++) {
if (this == values[i]) {
resultIndex = i - 1;
break;
}
}
if (resultIndex < 0) {
resultIndex = values.length - 1;
}
return values[resultIndex];
}
default void staticVoorElk(Consumer<T> consumer) {
for (T value:staticInstances()) {
consumer.accept(value);
}
}
}

View file

@ -5,7 +5,7 @@ package love.distributedrebirth.numberxd.base2t.bone;
* *
* @author willemtsade ©Δ 仙上主天 * @author willemtsade ©Δ 仙上主天
*/ */
public interface BasePartShiftBits extends BassBone { public interface BassBoneShiftBits<T extends BassBone<T>> extends BassBone<T> {
default Integer getShiftBits() { default Integer getShiftBits() {
return getBBC().getInteger(BassBoneStoreKey.SHIFT_BITS); return getBBC().getInteger(BassBoneStoreKey.SHIFT_BITS);

View file

@ -13,6 +13,9 @@ public enum BassBoneStoreKey {
CHINA_VALUE, CHINA_VALUE,
SHIFT_BITS, SHIFT_BITS,
MAP_TONE,
MAP_CHINA,
ALT_1_VALUE, ALT_1_VALUE,
ALT_2_VALUE, ALT_2_VALUE,
ALT_3_VALUE, ALT_3_VALUE,

View file

@ -22,13 +22,13 @@ public class T02PartBinaryTest {
@Test @Test
public void testToneMap() { public void testToneMap() {
Assertions.assertEquals(T02PartBinary.PART_1, T02PartBinary.valueOfTone("˧")); Assertions.assertEquals(T02PartBinary.PART_1, T02PartBinary.PART_1.staticValueOfTone("˧"));
Assertions.assertEquals(T02PartBinary.PART_2, T02PartBinary.valueOfTone("")); Assertions.assertEquals(T02PartBinary.PART_2, T02PartBinary.PART_1.staticValueOfTone(""));
} }
@Test @Test
public void testChinaMap() { public void testChinaMap() {
Assertions.assertEquals(T02PartBinary.PART_1, T02PartBinary.valueOfChina("")); Assertions.assertEquals(T02PartBinary.PART_1, T02PartBinary.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T02PartBinary.PART_2, T02PartBinary.valueOfChina("")); Assertions.assertEquals(T02PartBinary.PART_2, T02PartBinary.PART_1.staticValueOfChina(""));
} }
} }

View file

@ -22,15 +22,15 @@ public class T03PartTritTest {
@Test @Test
public void testToneMap() { public void testToneMap() {
Assertions.assertEquals(T03PartTrit.PART_1, T03PartTrit.valueOfTone("˦")); Assertions.assertEquals(T03PartTrit.PART_1, T03PartTrit.PART_1.staticValueOfTone("˦"));
Assertions.assertEquals(T03PartTrit.PART_2, T03PartTrit.valueOfTone("˧")); Assertions.assertEquals(T03PartTrit.PART_2, T03PartTrit.PART_1.staticValueOfTone("˧"));
Assertions.assertEquals(T03PartTrit.PART_3, T03PartTrit.valueOfTone("˨")); Assertions.assertEquals(T03PartTrit.PART_3, T03PartTrit.PART_1.staticValueOfTone("˨"));
} }
@Test @Test
public void testChinaMap() { public void testChinaMap() {
Assertions.assertEquals(T03PartTrit.PART_1, T03PartTrit.valueOfChina("")); Assertions.assertEquals(T03PartTrit.PART_1, T03PartTrit.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T03PartTrit.PART_2, T03PartTrit.valueOfChina("")); Assertions.assertEquals(T03PartTrit.PART_2, T03PartTrit.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T03PartTrit.PART_3, T03PartTrit.valueOfChina("")); Assertions.assertEquals(T03PartTrit.PART_3, T03PartTrit.PART_1.staticValueOfChina(""));
} }
} }

View file

@ -23,19 +23,35 @@ public class T04PartQuadTest {
} }
} }
@Test
public void testVolgende() {
Assertions.assertEquals(T04PartQuad.PART_1, T04PartQuad.PART_4.volgende());
Assertions.assertEquals(T04PartQuad.PART_2, T04PartQuad.PART_1.volgende());
Assertions.assertEquals(T04PartQuad.PART_3, T04PartQuad.PART_2.volgende());
Assertions.assertEquals(T04PartQuad.PART_4, T04PartQuad.PART_3.volgende());
}
@Test
public void testVorige() {
Assertions.assertEquals(T04PartQuad.PART_1, T04PartQuad.PART_2.vorige());
Assertions.assertEquals(T04PartQuad.PART_2, T04PartQuad.PART_3.vorige());
Assertions.assertEquals(T04PartQuad.PART_3, T04PartQuad.PART_4.vorige());
Assertions.assertEquals(T04PartQuad.PART_4, T04PartQuad.PART_1.vorige());
}
@Test @Test
public void testToneMap() { public void testToneMap() {
Assertions.assertEquals(T04PartQuad.PART_1, T04PartQuad.valueOfTone("˥")); Assertions.assertEquals(T04PartQuad.PART_1, T04PartQuad.PART_1.staticValueOfTone("˥"));
Assertions.assertEquals(T04PartQuad.PART_2, T04PartQuad.valueOfTone("")); Assertions.assertEquals(T04PartQuad.PART_2, T04PartQuad.PART_1.staticValueOfTone(""));
Assertions.assertEquals(T04PartQuad.PART_3, T04PartQuad.valueOfTone("")); Assertions.assertEquals(T04PartQuad.PART_3, T04PartQuad.PART_1.staticValueOfTone(""));
Assertions.assertEquals(T04PartQuad.PART_4, T04PartQuad.valueOfTone("˩")); Assertions.assertEquals(T04PartQuad.PART_4, T04PartQuad.PART_1.staticValueOfTone("˩"));
} }
@Test @Test
public void testChinaMap() { public void testChinaMap() {
Assertions.assertEquals(T04PartQuad.PART_1, T04PartQuad.valueOfChina("")); Assertions.assertEquals(T04PartQuad.PART_1, T04PartQuad.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T04PartQuad.PART_2, T04PartQuad.valueOfChina("")); Assertions.assertEquals(T04PartQuad.PART_2, T04PartQuad.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T04PartQuad.PART_3, T04PartQuad.valueOfChina("西")); Assertions.assertEquals(T04PartQuad.PART_3, T04PartQuad.PART_1.staticValueOfChina("西"));
Assertions.assertEquals(T04PartQuad.PART_4, T04PartQuad.valueOfChina("")); Assertions.assertEquals(T04PartQuad.PART_4, T04PartQuad.PART_1.staticValueOfChina(""));
} }
} }

View file

@ -22,19 +22,19 @@ public class T05PartPentalTest {
@Test @Test
public void testToneMap() { public void testToneMap() {
Assertions.assertEquals(T05PartPental.PART_1, T05PartPental.valueOfTone("˥")); Assertions.assertEquals(T05PartPental.PART_1, T05PartPental.PART_1.staticValueOfTone("˥"));
Assertions.assertEquals(T05PartPental.PART_2, T05PartPental.valueOfTone("˦")); Assertions.assertEquals(T05PartPental.PART_2, T05PartPental.PART_1.staticValueOfTone("˦"));
Assertions.assertEquals(T05PartPental.PART_3, T05PartPental.valueOfTone("˧")); Assertions.assertEquals(T05PartPental.PART_3, T05PartPental.PART_1.staticValueOfTone("˧"));
Assertions.assertEquals(T05PartPental.PART_4, T05PartPental.valueOfTone("˨")); Assertions.assertEquals(T05PartPental.PART_4, T05PartPental.PART_1.staticValueOfTone("˨"));
Assertions.assertEquals(T05PartPental.PART_5, T05PartPental.valueOfTone("˩")); Assertions.assertEquals(T05PartPental.PART_5, T05PartPental.PART_1.staticValueOfTone("˩"));
} }
@Test @Test
public void testChinaMap() { public void testChinaMap() {
Assertions.assertEquals(T05PartPental.PART_1, T05PartPental.valueOfChina("")); Assertions.assertEquals(T05PartPental.PART_1, T05PartPental.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T05PartPental.PART_2, T05PartPental.valueOfChina("")); Assertions.assertEquals(T05PartPental.PART_2, T05PartPental.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T05PartPental.PART_3, T05PartPental.valueOfChina("")); Assertions.assertEquals(T05PartPental.PART_3, T05PartPental.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T05PartPental.PART_4, T05PartPental.valueOfChina("")); Assertions.assertEquals(T05PartPental.PART_4, T05PartPental.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T05PartPental.PART_5, T05PartPental.valueOfChina("")); Assertions.assertEquals(T05PartPental.PART_5, T05PartPental.PART_1.staticValueOfChina(""));
} }
} }

View file

@ -25,17 +25,17 @@ public class T06PartSeximalTest {
@Test @Test
public void testToneMap() { public void testToneMap() {
Assertions.assertEquals(T06PartSeximal.PART_1, T06PartSeximal.valueOfTone("˦")); Assertions.assertEquals(T06PartSeximal.PART_1, T06PartSeximal.PART_1.staticValueOfTone("˦"));
Assertions.assertEquals(T06PartSeximal.PART_2, T06PartSeximal.valueOfTone("˨")); Assertions.assertEquals(T06PartSeximal.PART_2, T06PartSeximal.PART_1.staticValueOfTone("˨"));
Assertions.assertEquals(T06PartSeximal.PART_5, T06PartSeximal.valueOfTone("")); Assertions.assertEquals(T06PartSeximal.PART_5, T06PartSeximal.PART_1.staticValueOfTone(""));
Assertions.assertEquals(T06PartSeximal.PART_6, T06PartSeximal.valueOfTone("")); Assertions.assertEquals(T06PartSeximal.PART_6, T06PartSeximal.PART_1.staticValueOfTone(""));
} }
@Test @Test
public void testChinaMap() { public void testChinaMap() {
Assertions.assertEquals(T06PartSeximal.PART_1, T06PartSeximal.valueOfChina("")); Assertions.assertEquals(T06PartSeximal.PART_1, T06PartSeximal.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T06PartSeximal.PART_2, T06PartSeximal.valueOfChina("")); Assertions.assertEquals(T06PartSeximal.PART_2, T06PartSeximal.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T06PartSeximal.PART_5, T06PartSeximal.valueOfChina("")); Assertions.assertEquals(T06PartSeximal.PART_5, T06PartSeximal.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T06PartSeximal.PART_6, T06PartSeximal.valueOfChina("")); Assertions.assertEquals(T06PartSeximal.PART_6, T06PartSeximal.PART_1.staticValueOfChina(""));
} }
} }

View file

@ -25,17 +25,17 @@ public class T07PartPlanItTest {
@Test @Test
public void testToneMap() { public void testToneMap() {
Assertions.assertEquals(T07PartPlanIt.PART_1, T07PartPlanIt.valueOfTone("˥")); Assertions.assertEquals(T07PartPlanIt.PART_1, T07PartPlanIt.PART_1.staticValueOfTone("˥"));
Assertions.assertEquals(T07PartPlanIt.PART_2, T07PartPlanIt.valueOfTone("")); Assertions.assertEquals(T07PartPlanIt.PART_2, T07PartPlanIt.PART_1.staticValueOfTone(""));
Assertions.assertEquals(T07PartPlanIt.PART_6, T07PartPlanIt.valueOfTone("")); Assertions.assertEquals(T07PartPlanIt.PART_6, T07PartPlanIt.PART_1.staticValueOfTone(""));
Assertions.assertEquals(T07PartPlanIt.PART_7, T07PartPlanIt.valueOfTone("˩")); Assertions.assertEquals(T07PartPlanIt.PART_7, T07PartPlanIt.PART_1.staticValueOfTone("˩"));
} }
@Test @Test
public void testChinaMap() { public void testChinaMap() {
Assertions.assertEquals(T07PartPlanIt.PART_1, T07PartPlanIt.valueOfChina("♎︎")); Assertions.assertEquals(T07PartPlanIt.PART_1, T07PartPlanIt.PART_1.staticValueOfChina("♎︎"));
Assertions.assertEquals(T07PartPlanIt.PART_2, T07PartPlanIt.valueOfChina("♏︎")); Assertions.assertEquals(T07PartPlanIt.PART_2, T07PartPlanIt.PART_1.staticValueOfChina("♏︎"));
Assertions.assertEquals(T07PartPlanIt.PART_6, T07PartPlanIt.valueOfChina("♑︎")); Assertions.assertEquals(T07PartPlanIt.PART_6, T07PartPlanIt.PART_1.staticValueOfChina("♑︎"));
Assertions.assertEquals(T07PartPlanIt.PART_7, T07PartPlanIt.valueOfChina("♈︎")); Assertions.assertEquals(T07PartPlanIt.PART_7, T07PartPlanIt.PART_1.staticValueOfChina("♈︎"));
} }
} }

View file

@ -28,17 +28,17 @@ public class T08PartOctalTest {
@Test @Test
public void testToneMap() { public void testToneMap() {
Assertions.assertEquals(T08PartOctal.PART_1, T08PartOctal.valueOfTone("˥")); Assertions.assertEquals(T08PartOctal.PART_1, T08PartOctal.PART_1.staticValueOfTone("˥"));
Assertions.assertEquals(T08PartOctal.PART_2, T08PartOctal.valueOfTone("˩")); Assertions.assertEquals(T08PartOctal.PART_2, T08PartOctal.PART_1.staticValueOfTone("˩"));
Assertions.assertEquals(T08PartOctal.PART_7, T08PartOctal.valueOfTone("")); Assertions.assertEquals(T08PartOctal.PART_7, T08PartOctal.PART_1.staticValueOfTone(""));
Assertions.assertEquals(T08PartOctal.PART_8, T08PartOctal.valueOfTone("")); Assertions.assertEquals(T08PartOctal.PART_8, T08PartOctal.PART_1.staticValueOfTone(""));
} }
@Test @Test
public void testChinaMap() { public void testChinaMap() {
Assertions.assertEquals(T08PartOctal.PART_1, T08PartOctal.valueOfChina("")); Assertions.assertEquals(T08PartOctal.PART_1, T08PartOctal.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T08PartOctal.PART_2, T08PartOctal.valueOfChina("")); Assertions.assertEquals(T08PartOctal.PART_2, T08PartOctal.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T08PartOctal.PART_7, T08PartOctal.valueOfChina("")); Assertions.assertEquals(T08PartOctal.PART_7, T08PartOctal.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T08PartOctal.PART_8, T08PartOctal.valueOfChina("")); Assertions.assertEquals(T08PartOctal.PART_8, T08PartOctal.PART_1.staticValueOfChina(""));
} }
} }

View file

@ -22,17 +22,17 @@ public class T10PartDecimalTest {
@Test @Test
public void testToneMap() { public void testToneMap() {
Assertions.assertEquals(T10PartDecimal.PART_1, T10PartDecimal.valueOfTone("˥")); Assertions.assertEquals(T10PartDecimal.PART_1, T10PartDecimal.PART_1.staticValueOfTone("˥"));
Assertions.assertEquals(T10PartDecimal.PART_2, T10PartDecimal.valueOfTone("˦")); Assertions.assertEquals(T10PartDecimal.PART_2, T10PartDecimal.PART_1.staticValueOfTone("˦"));
Assertions.assertEquals(T10PartDecimal.PART_9, T10PartDecimal.valueOfTone("")); Assertions.assertEquals(T10PartDecimal.PART_9, T10PartDecimal.PART_1.staticValueOfTone(""));
Assertions.assertEquals(T10PartDecimal.PART_10, T10PartDecimal.valueOfTone("")); Assertions.assertEquals(T10PartDecimal.PART_10, T10PartDecimal.PART_1.staticValueOfTone(""));
} }
@Test @Test
public void testChinaMap() { public void testChinaMap() {
Assertions.assertEquals(T10PartDecimal.PART_1, T10PartDecimal.valueOfChina("")); Assertions.assertEquals(T10PartDecimal.PART_1, T10PartDecimal.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T10PartDecimal.PART_2, T10PartDecimal.valueOfChina("")); Assertions.assertEquals(T10PartDecimal.PART_2, T10PartDecimal.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T10PartDecimal.PART_9, T10PartDecimal.valueOfChina("")); Assertions.assertEquals(T10PartDecimal.PART_9, T10PartDecimal.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T10PartDecimal.PART_10, T10PartDecimal.valueOfChina("")); Assertions.assertEquals(T10PartDecimal.PART_10, T10PartDecimal.PART_1.staticValueOfChina(""));
} }
} }

View file

@ -22,17 +22,17 @@ public class T11PartUndecimalTest {
@Test @Test
public void testToneMap() { public void testToneMap() {
Assertions.assertEquals(T11PartUndecimal.PART_1, T11PartUndecimal.valueOfTone("˥")); Assertions.assertEquals(T11PartUndecimal.PART_1, T11PartUndecimal.PART_1.staticValueOfTone("˥"));
Assertions.assertEquals(T11PartUndecimal.PART_2, T11PartUndecimal.valueOfTone("")); Assertions.assertEquals(T11PartUndecimal.PART_2, T11PartUndecimal.PART_1.staticValueOfTone(""));
Assertions.assertEquals(T11PartUndecimal.PART_10, T11PartUndecimal.valueOfTone("")); Assertions.assertEquals(T11PartUndecimal.PART_10, T11PartUndecimal.PART_1.staticValueOfTone(""));
Assertions.assertEquals(T11PartUndecimal.PART_11, T11PartUndecimal.valueOfTone("˩")); Assertions.assertEquals(T11PartUndecimal.PART_11, T11PartUndecimal.PART_1.staticValueOfTone("˩"));
} }
@Test @Test
public void testChinaMap() { public void testChinaMap() {
Assertions.assertEquals(T11PartUndecimal.PART_1, T11PartUndecimal.valueOfChina("")); Assertions.assertEquals(T11PartUndecimal.PART_1, T11PartUndecimal.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T11PartUndecimal.PART_2, T11PartUndecimal.valueOfChina("")); Assertions.assertEquals(T11PartUndecimal.PART_2, T11PartUndecimal.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T11PartUndecimal.PART_10, T11PartUndecimal.valueOfChina("")); Assertions.assertEquals(T11PartUndecimal.PART_10, T11PartUndecimal.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T11PartUndecimal.PART_11, T11PartUndecimal.valueOfChina("")); Assertions.assertEquals(T11PartUndecimal.PART_11, T11PartUndecimal.PART_1.staticValueOfChina(""));
} }
} }

View file

@ -25,17 +25,17 @@ public class T12PartUncialTest {
@Test @Test
public void testToneMap() { public void testToneMap() {
Assertions.assertEquals(T12PartUncial.PART_1, T12PartUncial.valueOfTone("˥")); Assertions.assertEquals(T12PartUncial.PART_1, T12PartUncial.PART_1.staticValueOfTone("˥"));
Assertions.assertEquals(T12PartUncial.PART_2, T12PartUncial.valueOfTone("˧")); Assertions.assertEquals(T12PartUncial.PART_2, T12PartUncial.PART_1.staticValueOfTone("˧"));
Assertions.assertEquals(T12PartUncial.PART_11, T12PartUncial.valueOfTone("")); Assertions.assertEquals(T12PartUncial.PART_11, T12PartUncial.PART_1.staticValueOfTone(""));
Assertions.assertEquals(T12PartUncial.PART_12, T12PartUncial.valueOfTone("")); Assertions.assertEquals(T12PartUncial.PART_12, T12PartUncial.PART_1.staticValueOfTone(""));
} }
@Test @Test
public void testChinaMap() { public void testChinaMap() {
Assertions.assertEquals(T12PartUncial.PART_1, T12PartUncial.valueOfChina("")); Assertions.assertEquals(T12PartUncial.PART_1, T12PartUncial.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T12PartUncial.PART_2, T12PartUncial.valueOfChina("")); Assertions.assertEquals(T12PartUncial.PART_2, T12PartUncial.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T12PartUncial.PART_11, T12PartUncial.valueOfChina("")); Assertions.assertEquals(T12PartUncial.PART_11, T12PartUncial.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T12PartUncial.PART_12, T12PartUncial.valueOfChina("")); Assertions.assertEquals(T12PartUncial.PART_12, T12PartUncial.PART_1.staticValueOfChina(""));
} }
} }

View file

@ -25,17 +25,17 @@ public class T16PartHexTest {
@Test @Test
public void testToneMap() { public void testToneMap() {
Assertions.assertEquals(T16PartHex.PART_1, T16PartHex.valueOfTone("˥")); Assertions.assertEquals(T16PartHex.PART_1, T16PartHex.PART_1.staticValueOfTone("˥"));
Assertions.assertEquals(T16PartHex.PART_2, T16PartHex.valueOfTone("˦")); Assertions.assertEquals(T16PartHex.PART_2, T16PartHex.PART_1.staticValueOfTone("˦"));
Assertions.assertEquals(T16PartHex.PART_15, T16PartHex.valueOfTone("")); Assertions.assertEquals(T16PartHex.PART_15, T16PartHex.PART_1.staticValueOfTone(""));
Assertions.assertEquals(T16PartHex.PART_16, T16PartHex.valueOfTone("")); Assertions.assertEquals(T16PartHex.PART_16, T16PartHex.PART_1.staticValueOfTone(""));
} }
@Test @Test
public void testChinaMap() { public void testChinaMap() {
Assertions.assertEquals(T16PartHex.PART_1, T16PartHex.valueOfChina("")); Assertions.assertEquals(T16PartHex.PART_1, T16PartHex.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T16PartHex.PART_2, T16PartHex.valueOfChina("")); Assertions.assertEquals(T16PartHex.PART_2, T16PartHex.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T16PartHex.PART_15, T16PartHex.valueOfChina("")); Assertions.assertEquals(T16PartHex.PART_15, T16PartHex.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T16PartHex.PART_16, T16PartHex.valueOfChina("")); Assertions.assertEquals(T16PartHex.PART_16, T16PartHex.PART_1.staticValueOfChina(""));
} }
} }

View file

@ -25,25 +25,25 @@ public class T20PartScoreTest {
@Test @Test
public void testToneMap() { public void testToneMap() {
Assertions.assertEquals(T20PartScore.PART_1, T20PartScore.valueOfTone("˥")); Assertions.assertEquals(T20PartScore.PART_1, T20PartScore.PART_1.staticValueOfTone("˥"));
Assertions.assertEquals(T20PartScore.PART_2, T20PartScore.valueOfTone("˦")); Assertions.assertEquals(T20PartScore.PART_2, T20PartScore.PART_1.staticValueOfTone("˦"));
Assertions.assertEquals(T20PartScore.PART_19, T20PartScore.valueOfTone("")); Assertions.assertEquals(T20PartScore.PART_19, T20PartScore.PART_1.staticValueOfTone(""));
Assertions.assertEquals(T20PartScore.PART_20, T20PartScore.valueOfTone("")); Assertions.assertEquals(T20PartScore.PART_20, T20PartScore.PART_1.staticValueOfTone(""));
} }
@Test @Test
public void testChinaMap() { public void testChinaMap() {
Assertions.assertEquals(T20PartScore.PART_1, T20PartScore.valueOfChina("")); Assertions.assertEquals(T20PartScore.PART_1, T20PartScore.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T20PartScore.PART_2, T20PartScore.valueOfChina("")); Assertions.assertEquals(T20PartScore.PART_2, T20PartScore.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T20PartScore.PART_19, T20PartScore.valueOfChina("")); Assertions.assertEquals(T20PartScore.PART_19, T20PartScore.PART_1.staticValueOfChina(""));
Assertions.assertEquals(T20PartScore.PART_20, T20PartScore.valueOfChina("")); Assertions.assertEquals(T20PartScore.PART_20, T20PartScore.PART_1.staticValueOfChina(""));
} }
@Test @Test
public void testOpenLCMap() { public void testOpenLCMap() {
Assertions.assertEquals(T20PartScore.PART_1, T20PartScore.valueOfOpenLC("2")); Assertions.assertEquals(T20PartScore.PART_1, T20PartScore.PART_1.staticValueOfOpenLC("2"));
Assertions.assertEquals(T20PartScore.PART_2, T20PartScore.valueOfOpenLC("3")); Assertions.assertEquals(T20PartScore.PART_2, T20PartScore.PART_1.staticValueOfOpenLC("3"));
Assertions.assertEquals(T20PartScore.PART_19, T20PartScore.valueOfOpenLC("W")); Assertions.assertEquals(T20PartScore.PART_19, T20PartScore.PART_1.staticValueOfOpenLC("W"));
Assertions.assertEquals(T20PartScore.PART_20, T20PartScore.valueOfOpenLC("X")); Assertions.assertEquals(T20PartScore.PART_20, T20PartScore.PART_1.staticValueOfOpenLC("X"));
} }
} }