diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/GroßGetậl6ˢᴰ.java b/numberxd/src/main/love/distributedrebirth/numberxd/GroßGetậl6ˢᴰ.java index c09f3597..01e65802 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/GroßGetậl6ˢᴰ.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/GroßGetậl6ˢᴰ.java @@ -55,11 +55,11 @@ public class GroßGetậl6ˢᴰ implements BaseNumberTyte { @Override public void fillOctalsByClone(T08PartOctalBaseAppender appender) { - T12PartUncial.forEach(v -> getValue(v).fillOctalsByClone(appender)); + T12PartUncial.PART_1.staticVoorElk(v -> getValue(v).fillOctalsByClone(appender)); } @Override public void fillTytesByReference(V009TyteBaseAppender appender) { - T12PartUncial.forEach(v -> getValue(v).fillTytesByReference(appender)); + T12PartUncial.PART_1.staticVoorElk(v -> getValue(v).fillTytesByReference(appender)); } } diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/KlompGetậl4ˢᴰ.java b/numberxd/src/main/love/distributedrebirth/numberxd/KlompGetậl4ˢᴰ.java index 30a4091b..6ad63c66 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/KlompGetậl4ˢᴰ.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/KlompGetậl4ˢᴰ.java @@ -53,11 +53,11 @@ public class KlompGetậl4ˢᴰ implements BaseNumberTyte { @Override public void fillOctalsByClone(T08PartOctalBaseAppender appender) { - T08PartOctal.forEach(v -> getValue(v).fillOctalsByClone(appender)); + T08PartOctal.PART_1.staticVoorElk(v -> getValue(v).fillOctalsByClone(appender)); } @Override public void fillTytesByReference(V009TyteBaseAppender appender) { - T08PartOctal.forEach(v -> getValue(v).fillTytesByReference(appender)); + T08PartOctal.PART_1.staticVoorElk(v -> getValue(v).fillTytesByReference(appender)); } } diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/Base2Terminator.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/Base2Terminator.java index 6c00c49f..a314c8dc 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/Base2Terminator.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/Base2Terminator.java @@ -63,7 +63,7 @@ public class Base2Terminator { private List base2ReadOctals(int...values) { List octals = new ArrayList<>(); 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; } diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T02PartBinary.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T02PartBinary.java index 1867b7c8..2339605d 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T02PartBinary.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T02PartBinary.java @@ -1,11 +1,5 @@ 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.BassBoneCoffin; import love.distributedrebirth.numberxd.base2t.bone.BassBoneName; @@ -17,7 +11,7 @@ import love.distributedrebirth.numberxd.base2t.bone.BassBoneStoreKey; * @author willemtsade ©Δ∞ 仙上主天 */ @BassBoneName("T02PartBinary") -public enum T02PartBinary implements BassBone { +public enum T02PartBinary implements BassBone { PART_1("˧","0", "低", "low"), PART_2("꜔","1", "高", "high"), @@ -25,34 +19,18 @@ public enum T02PartBinary implements BassBone { public static int LENGTH() { return values().length; }; private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); - private static final Map TONE_MAP = Collections.unmodifiableMap( - Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v))); - private static final Map 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) { - this.getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); - this.getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); - this.getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); - this.getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); + getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); + getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); + getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); + getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); + getBBC().getMapObject(BassBoneStoreKey.MAP_TONE); + getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA); } @Override public BassBoneCoffin getBBC() { return bbc; } - - public static void forEach(Consumer 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); - } } diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T03PartTrit.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T03PartTrit.java index 7a793d61..69fe8308 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T03PartTrit.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T03PartTrit.java @@ -1,11 +1,5 @@ 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.BassBoneCoffin; import love.distributedrebirth.numberxd.base2t.bone.BassBoneName; @@ -17,7 +11,7 @@ import love.distributedrebirth.numberxd.base2t.bone.BassBoneStoreKey; * @author willemtsade ©Δ∞ 仙上主天 */ @BassBoneName("T03PartTrit") -public enum T03PartTrit implements BassBone { +public enum T03PartTrit implements BassBone { PART_1("˦","0","一","1"), PART_2("˧","1","二","2"), @@ -26,34 +20,18 @@ public enum T03PartTrit implements BassBone { public static int LENGTH() { return values().length; }; private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); - private static final Map TONE_MAP = Collections.unmodifiableMap( - Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v))); - private static final Map 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) { - this.getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); - this.getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); - this.getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); - this.getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); + getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); + getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); + getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); + getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); + getBBC().getMapObject(BassBoneStoreKey.MAP_TONE); + getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA); } @Override public BassBoneCoffin getBBC() { return bbc; } - - public static void forEach(Consumer 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); - } } diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T04PartQuad.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T04PartQuad.java index 7b7f0bea..7bb0ff78 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T04PartQuad.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T04PartQuad.java @@ -1,13 +1,5 @@ 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.BassBoneAlt1Info; import love.distributedrebirth.numberxd.base2t.bone.BassBoneCoffin; @@ -21,7 +13,7 @@ import love.distributedrebirth.numberxd.base2t.bone.BassBoneStoreKey; */ @BassBoneName("T04PartQuad") @BassBoneAlt1Info(name="Cardinal direction", website="https://simple.wikipedia.org/wiki/Cardinal_direction") -public enum T04PartQuad implements BassBone,BassBoneAlt1,BasePartSplit4 { +public enum T04PartQuad implements BassBoneAlt1 { PART_1("˥","0","北","north","N"), PART_2("꜒","1","東","east", "E"), @@ -31,17 +23,15 @@ public enum T04PartQuad implements BassBone,BassBoneAlt1,BasePartSplit4 { public static int LENGTH() { return values().length; }; private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); - private static final Map TONE_MAP = Collections.unmodifiableMap( - Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v))); - private static final Map 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) { - this.getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); - this.getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); - this.getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); - this.getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); - this.getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); + getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); + getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); + getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); + getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); + getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); + getBBC().getMapObject(BassBoneStoreKey.MAP_TONE); + getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA); } @Override @@ -49,17 +39,7 @@ public enum T04PartQuad implements BassBone,BassBoneAlt1,BasePartSplit4 { return bbc; } - public static void forEach(Consumer consumer) { - for (T04PartQuad value:values()) { - 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); + public T02PartBinary splitPartBinary(T02PartBinary part) { + return T02PartBinary.values()[(ordinal() >> part.ordinal()) & 1]; } } diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T05PartPental.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T05PartPental.java index dd6cb1af..f8913352 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T05PartPental.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T05PartPental.java @@ -1,12 +1,5 @@ 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.BassBoneAlt2; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt2Info; @@ -22,7 +15,7 @@ import love.distributedrebirth.numberxd.base2t.bone.BassBoneStoreKey; @BassBoneName("T05PartPental") @BassBoneAlt1Info(name="Pentagram", website="https://en.wikipedia.org/wiki/Pentagram") @BassBoneAlt2Info(name="Pythagorean Interpretations", website="http://wisdomofhypatia.com/OM/BA/PP.html") -public enum T05PartPental implements BassBone,BassBoneAlt2 { +public enum T05PartPental implements BassBoneAlt2 { PART_1("˥","0","火","fire", "EI","heile"), PART_2("˦","1","水","water","U", "hudor"), @@ -33,36 +26,20 @@ public enum T05PartPental implements BassBone,BassBoneAlt2 { public static int LENGTH() { return values().length; }; private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); - private static final Map TONE_MAP = Collections.unmodifiableMap( - Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v))); - private static final Map 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) { - this.getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); - this.getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); - this.getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); - this.getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); - this.getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); - this.getBBC().putInit(BassBoneStoreKey.ALT_2_VALUE, alt2Value); + getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); + getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); + getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); + getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); + getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); + getBBC().putInit(BassBoneStoreKey.ALT_2_VALUE, alt2Value); + getBBC().getMapObject(BassBoneStoreKey.MAP_TONE); + getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA); } @Override public BassBoneCoffin getBBC() { return bbc; } - - public static void forEach(Consumer 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); - } } diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T06PartSeximal.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T06PartSeximal.java index dfa04fee..4f3b28a6 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T06PartSeximal.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T06PartSeximal.java @@ -1,13 +1,5 @@ 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.BassBoneAlt1Info; import love.distributedrebirth.numberxd.base2t.bone.BassBoneCoffin; @@ -23,7 +15,7 @@ import love.distributedrebirth.numberxd.base2t.bone.BassBoneStoreKey; */ @BassBoneName("T06PartSeximal") @BassBoneAlt1Info(name="ADFGVX cipher", website="https://en.wikipedia.org/wiki/ADFGVX_cipher") -public enum T06PartSeximal implements BassBone,BassBoneAlt1,BasePartSplit6 { +public enum T06PartSeximal implements BassBoneAlt1 { PART_1("˦","0","四","4","A"), PART_2("˨","1","五","5","D"), @@ -35,17 +27,15 @@ public enum T06PartSeximal implements BassBone,BassBoneAlt1,BasePartSplit6 { public static int LENGTH() { return values().length; }; private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); - private static final Map TONE_MAP = Collections.unmodifiableMap( - Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v))); - private static final Map 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) { - this.getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); - this.getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); - this.getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); - this.getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); - this.getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); + getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); + getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); + getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); + getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); + getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); + getBBC().getMapObject(BassBoneStoreKey.MAP_TONE); + getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA); } @Override @@ -53,17 +43,11 @@ public enum T06PartSeximal implements BassBone,BassBoneAlt1,BasePartSplit6 { return bbc; } - public static void forEach(Consumer consumer) { - for (T06PartSeximal value:values()) { - consumer.accept(value); - } + public T02PartBinary splitPartBinary() { + return T02PartBinary.values()[ordinal() & 1]; } - public static T06PartSeximal valueOfTone(String identifierTone) { - return TONE_MAP.get(identifierTone); - } - - public static T06PartSeximal valueOfChina(String chinaKey) { - return CHINA_MAP.get(chinaKey); + public T03PartTrit splitPartTrit() { + return T03PartTrit.values()[ordinal() >> 1]; } } diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T07PartPlanIt.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T07PartPlanIt.java index cf263697..cf53332a 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T07PartPlanIt.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T07PartPlanIt.java @@ -1,12 +1,5 @@ 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.BassBoneAlt1Info; import love.distributedrebirth.numberxd.base2t.bone.BassBoneCoffin; @@ -20,7 +13,7 @@ import love.distributedrebirth.numberxd.base2t.bone.BassBoneStoreKey; */ @BassBoneName("T07PartPlanIt") @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 { PART_1("˥","0","♎︎","libra","天秤座"), PART_2("꜉","1","♏︎","scorpio","天蠍座"), @@ -33,35 +26,19 @@ public enum T07PartPlanIt implements BassBone,BassBoneAlt1 { public static int LENGTH() { return values().length; }; private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); - private static final Map TONE_MAP = Collections.unmodifiableMap( - Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v))); - private static final Map 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) { - this.getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); - this.getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); - this.getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); - this.getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); - this.getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); + getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); + getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); + getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); + getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); + getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); + getBBC().getMapObject(BassBoneStoreKey.MAP_TONE); + getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA); } @Override public BassBoneCoffin getBBC() { return bbc; } - - public static void forEach(Consumer 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); - } } diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T08PartOctal.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T08PartOctal.java index 5ae71a7f..e6924210 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T08PartOctal.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T08PartOctal.java @@ -1,13 +1,6 @@ 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.BasePartSplit8; -import love.distributedrebirth.numberxd.base2t.bone.BassBone; +import love.distributedrebirth.numberxd.base2t.bone.BassBoneShiftBits; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt1Info; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt2; import love.distributedrebirth.numberxd.base2t.bone.BassBoneAlt2Info; @@ -23,7 +16,7 @@ import love.distributedrebirth.numberxd.base2t.bone.BassBoneStoreKey; @BassBoneName("T08PartOctal") @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") -public enum T08PartOctal implements BassBone,BassBoneAlt2,BasePartSplit8 { +public enum T08PartOctal implements BassBoneAlt2,BassBoneShiftBits { PART_1("˥","0","心","heart","˧˥˩","˥˩˧", 0), PART_2("˩","1","頭","head", "˧˩˥","˩˥˧", 3), @@ -39,19 +32,17 @@ public enum T08PartOctal implements BassBone,BassBoneAlt2,BasePartSplit8 { public static int BIT_COUNT = 3; private static final byte BITMASK = 0x07; private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); - private static final Map TONE_MAP = Collections.unmodifiableMap( - Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v))); - private static final Map 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) { - this.getBBC().putInit(BassBoneStoreKey.ID_TONE, identifierTone); - this.getBBC().putInit(BassBoneStoreKey.ID_LETTER, identifierLetter); - this.getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); - this.getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); - this.getBBC().putInit(BassBoneStoreKey.SHIFT_BITS, Integer.valueOf(shiftBits)); - this.getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); - this.getBBC().putInit(BassBoneStoreKey.ALT_2_VALUE, alt2Value); + getBBC().putInit(BassBoneStoreKey.ID_TONE, identifierTone); + getBBC().putInit(BassBoneStoreKey.ID_LETTER, identifierLetter); + getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); + getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); + getBBC().putInit(BassBoneStoreKey.SHIFT_BITS, Integer.valueOf(shiftBits)); + getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); + getBBC().putInit(BassBoneStoreKey.ALT_2_VALUE, alt2Value); + getBBC().getMapObject(BassBoneStoreKey.MAP_TONE); + getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA); } @Override @@ -63,17 +54,11 @@ public enum T08PartOctal implements BassBone,BassBoneAlt2,BasePartSplit8 { return T08PartOctal.values()[(value >> group.getShiftBits()) & BITMASK]; } - public static void forEach(Consumer consumer) { - for (T08PartOctal value:values()) { - consumer.accept(value); - } + public T02PartBinary splitPartBinary(T03PartTrit part) { + return T02PartBinary.values()[(ordinal() >> part.ordinal()) & 1]; } - public static T08PartOctal valueOfTone(String identifierTone) { - return TONE_MAP.get(identifierTone); - } - - public static T08PartOctal valueOfChina(String chinaKey) { - return CHINA_MAP.get(chinaKey); + public int ordinalOf(T08PartOctal group) { + return ordinal() << group.getShiftBits(); } } diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T10PartDecimal.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T10PartDecimal.java index 374d52d2..3b1cea26 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T10PartDecimal.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T10PartDecimal.java @@ -1,12 +1,5 @@ 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.BassBoneAlt2Info; 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") @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") -public enum T10PartDecimal implements BassBone,BassBoneAlt4 { +public enum T10PartDecimal implements BassBoneAlt4 { PART_1 ("˥","ō","零","zero", "영","\u1040","০", "෦"), PART_2 ("˦","α","壹","one", "일","\u1041","১", "෧"), @@ -42,39 +35,23 @@ public enum T10PartDecimal implements BassBone,BassBoneAlt4 { public static int LENGTH() { return values().length; }; private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); - private static final Map TONE_MAP = Collections.unmodifiableMap( - Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v))); - private static final Map 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, String alt1Value, String alt2Value, String alt3Value, String alt4Value) { - this.getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); - this.getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); - this.getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); - this.getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); - this.getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); - this.getBBC().putInit(BassBoneStoreKey.ALT_2_VALUE, alt2Value); - this.getBBC().putInit(BassBoneStoreKey.ALT_3_VALUE, alt3Value); - this.getBBC().putInit(BassBoneStoreKey.ALT_4_VALUE, alt4Value); + getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); + getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); + getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); + getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); + getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); + getBBC().putInit(BassBoneStoreKey.ALT_2_VALUE, alt2Value); + getBBC().putInit(BassBoneStoreKey.ALT_3_VALUE, alt3Value); + getBBC().putInit(BassBoneStoreKey.ALT_4_VALUE, alt4Value); + getBBC().getMapObject(BassBoneStoreKey.MAP_TONE); + getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA); } @Override public BassBoneCoffin getBBC() { return bbc; } - - public static void forEach(Consumer 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); - } } diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T11PartUndecimal.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T11PartUndecimal.java index 3fb0e0ca..f945a766 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T11PartUndecimal.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T11PartUndecimal.java @@ -1,12 +1,5 @@ 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.BassBoneAlt1Info; import love.distributedrebirth.numberxd.base2t.bone.BassBoneCoffin; @@ -20,7 +13,7 @@ import love.distributedrebirth.numberxd.base2t.bone.BassBoneStoreKey; */ @BassBoneName("T11PartUndecimal") @BassBoneAlt1Info(name="Tamil numerals", website="https://en.wikipedia.org/wiki/Tamil_numerals") -public enum T11PartUndecimal implements BassBone,BassBoneAlt1 { +public enum T11PartUndecimal implements BassBoneAlt1 { PART_1 ("˥","0","走","walk", "௦"), PART_2 ("꜈","1","跑","run", "௧"), @@ -37,35 +30,19 @@ public enum T11PartUndecimal implements BassBone,BassBoneAlt1 { public static int LENGTH() { return values().length; }; private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); - private static final Map TONE_MAP = Collections.unmodifiableMap( - Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v))); - private static final Map 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) { - this.getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); - this.getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); - this.getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); - this.getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); - this.getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); + getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); + getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); + getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); + getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); + getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); + getBBC().getMapObject(BassBoneStoreKey.MAP_TONE); + getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA); } @Override public BassBoneCoffin getBBC() { return bbc; } - - public static void forEach(Consumer 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); - } } diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T12PartUncial.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T12PartUncial.java index 6183bd80..beb6ed4c 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T12PartUncial.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T12PartUncial.java @@ -1,12 +1,5 @@ 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.BassBoneAlt1Info; import love.distributedrebirth.numberxd.base2t.bone.BassBoneCoffin; @@ -20,7 +13,7 @@ import love.distributedrebirth.numberxd.base2t.bone.BassBoneStoreKey; */ @BassBoneName("T12PartUncial") @BassBoneAlt1Info(name="Transdecimal symbols", website="https://en.wikipedia.org/wiki/Duodecimal#Transdecimal_symbols") -public enum T12PartUncial implements BassBone,BassBoneAlt1 { +public enum T12PartUncial implements BassBoneAlt1 { PART_1 ("˥","0","日","sun", "0"), PART_2 ("˧","1","月","moon", "1"), @@ -38,35 +31,19 @@ public enum T12PartUncial implements BassBone,BassBoneAlt1 { public static int LENGTH() { return values().length; }; private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); - private static final Map TONE_MAP = Collections.unmodifiableMap( - Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v))); - private static final Map 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) { - this.getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); - this.getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); - this.getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); - this.getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); - this.getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); + getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); + getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); + getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); + getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); + getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); + getBBC().getMapObject(BassBoneStoreKey.MAP_TONE); + getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA); } @Override public BassBoneCoffin getBBC() { return bbc; } - - public static void forEach(Consumer 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); - } } diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T16PartHex.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T16PartHex.java index 39cdcbcc..f7d67ab6 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T16PartHex.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T16PartHex.java @@ -1,13 +1,5 @@ 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.BassBoneAlt1Info; import love.distributedrebirth.numberxd.base2t.bone.BassBoneCoffin; @@ -21,7 +13,7 @@ import love.distributedrebirth.numberxd.base2t.bone.BassBoneStoreKey; */ @BassBoneName("T16PartHex") @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 { PART_1 ("˥","0","氫","hydrogen", "1"), PART_2 ("˦","1","氦","helium", "2"), @@ -43,17 +35,15 @@ public enum T16PartHex implements BassBone,BassBoneAlt1,BasePartSplit16 { public static int LENGTH() { return values().length; }; private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); - private static final Map TONE_MAP = Collections.unmodifiableMap( - Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v))); - private static final Map 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) { - this.getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); - this.getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); - this.getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); - this.getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); - this.getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); + getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); + getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); + getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); + getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); + getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); + getBBC().getMapObject(BassBoneStoreKey.MAP_TONE); + getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA); } @Override @@ -61,17 +51,7 @@ public enum T16PartHex implements BassBone,BassBoneAlt1,BasePartSplit16 { return bbc; } - public static void forEach(Consumer consumer) { - for (T16PartHex value:values()) { - 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); + public T02PartBinary splitPartBinary(T04PartQuad part) { + return T02PartBinary.values()[(ordinal() >> part.ordinal()) & 1]; } } diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T20PartScore.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T20PartScore.java index 354be949..6e2f7251 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T20PartScore.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/T20PartScore.java @@ -3,10 +3,8 @@ 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.BassBoneAlt2Info; 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") @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") -public enum T20PartScore implements BassBone,BassBoneAlt3 { +public enum T20PartScore implements BassBoneAlt3 { PART_1 ("˥","Y", "尧","yotta","0","0","2"), PART_2 ("˦","Z", "泽","zetta","1","1","3"), @@ -50,22 +48,20 @@ public enum T20PartScore implements BassBone,BassBoneAlt3 { public static int LENGTH() { return values().length; }; private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); - private static final Map TONE_MAP = Collections.unmodifiableMap( - Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v))); - private static final Map CHINA_MAP = Collections.unmodifiableMap( - Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getChinaKey(), v -> v))); private static final Map OPENLC_MAP = Collections.unmodifiableMap( Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getAlt3Value(), v -> v))); private T20PartScore(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value, String alt2Value, String alt3Value) { - this.getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); - this.getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); - this.getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); - this.getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); - this.getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); - this.getBBC().putInit(BassBoneStoreKey.ALT_2_VALUE, alt2Value); - this.getBBC().putInit(BassBoneStoreKey.ALT_3_VALUE, alt3Value); + getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); + getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); + getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); + getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); + getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); + getBBC().putInit(BassBoneStoreKey.ALT_2_VALUE, alt2Value); + getBBC().putInit(BassBoneStoreKey.ALT_3_VALUE, alt3Value); + getBBC().getMapObject(BassBoneStoreKey.MAP_TONE); + getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA); } @Override @@ -73,21 +69,7 @@ public enum T20PartScore implements BassBone,BassBoneAlt3 { return bbc; } - public static void forEach(Consumer consumer) { - 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) { + public T20PartScore staticValueOfOpenLC(String openLCKey) { return OPENLC_MAP.get(openLCKey); } } diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V006Tixte.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V006Tixte.java index 93ea684f..136eb6b4 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V006Tixte.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V006Tixte.java @@ -43,6 +43,6 @@ public final class V006Tixte implements BaseNumber { @Override public void fillOctalsByClone(T08PartOctalBaseAppender appender) { - T02PartBinary.forEach(v -> getValue(v).fillOctalsByClone(appender)); + T02PartBinary.PART_1.staticVoorElk(v -> getValue(v).fillOctalsByClone(appender)); } } diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V009Tyte.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V009Tyte.java index 6f32e64e..35fd2dca 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V009Tyte.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V009Tyte.java @@ -44,7 +44,7 @@ public final class V009Tyte implements BaseNumberTyte { @Override public void fillOctalsByClone(T08PartOctalBaseAppender appender) { - T03PartTrit.forEach(v -> getValue(v).fillOctalsByClone(appender)); + T03PartTrit.PART_1.staticVoorElk(v -> getValue(v).fillOctalsByClone(appender)); } @Override diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V012Tord.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V012Tord.java index 5497df19..81def4d9 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V012Tord.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V012Tord.java @@ -51,11 +51,11 @@ public final class V012Tord implements BaseNumberTyte { @Override public void fillOctalsByClone(T08PartOctalBaseAppender appender) { - T02PartBinary.forEach(v -> getValue(v).fillOctalsByClone(appender)); + T02PartBinary.PART_1.staticVoorElk(v -> getValue(v).fillOctalsByClone(appender)); } @Override public void fillTytesByReference(V009TyteBaseAppender appender) { - T02PartBinary.forEach(v -> getValue(v).fillTytesByReference(appender)); + T02PartBinary.PART_1.staticVoorElk(v -> getValue(v).fillTytesByReference(appender)); } } diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V01BTemvig.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V01BTemvig.java index e3faf930..27f660e2 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V01BTemvig.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V01BTemvig.java @@ -48,11 +48,11 @@ public final class V01BTemvig implements BaseNumberTyte { @Override public void fillOctalsByClone(T08PartOctalBaseAppender appender) { - T03PartTrit.forEach(v -> getValue(v).fillOctalsByClone(appender)); + T03PartTrit.PART_1.staticVoorElk(v -> getValue(v).fillOctalsByClone(appender)); } @Override public void fillTytesByReference(V009TyteBaseAppender appender) { - T03PartTrit.forEach(v -> getValue(v).fillTytesByReference(appender)); + T03PartTrit.PART_1.staticVoorElk(v -> getValue(v).fillTytesByReference(appender)); } } diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V024Teger.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V024Teger.java index 2dd6e4a8..d6b97011 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V024Teger.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V024Teger.java @@ -57,11 +57,11 @@ public final class V024Teger implements BaseNumberTyte { @Override public void fillOctalsByClone(T08PartOctalBaseAppender appender) { - T02PartBinary.forEach(v -> getValue(v).fillOctalsByClone(appender)); + T02PartBinary.PART_1.staticVoorElk(v -> getValue(v).fillOctalsByClone(appender)); } @Override public void fillTytesByReference(V009TyteBaseAppender appender) { - T02PartBinary.forEach(v -> getValue(v).fillTytesByReference(appender)); + T02PartBinary.PART_1.staticVoorElk(v -> getValue(v).fillTytesByReference(appender)); } } diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V02ATraw.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V02ATraw.java index dfb1d19a..e1d7ae69 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V02ATraw.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V02ATraw.java @@ -42,6 +42,6 @@ public final class V02ATraw implements BaseNumber { @Override public void fillOctalsByClone(T08PartOctalBaseAppender appender) { - T07PartPlanIt.forEach(v -> getValue(v).fillOctalsByClone(appender)); + T07PartPlanIt.PART_1.staticVoorElk(v -> getValue(v).fillOctalsByClone(appender)); } } diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V048Tong.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V048Tong.java index a6c0dd8c..ed16a21b 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V048Tong.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V048Tong.java @@ -59,11 +59,11 @@ public final class V048Tong implements BaseNumberTyte { @Override public void fillOctalsByClone(T08PartOctalBaseAppender appender) { - T02PartBinary.forEach(v -> getValue(v).fillOctalsByClone(appender)); + T02PartBinary.PART_1.staticVoorElk(v -> getValue(v).fillOctalsByClone(appender)); } @Override public void fillTytesByReference(V009TyteBaseAppender appender) { - T02PartBinary.forEach(v -> getValue(v).fillTytesByReference(appender)); + T02PartBinary.PART_1.staticVoorElk(v -> getValue(v).fillTytesByReference(appender)); } } diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V090Tocta.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V090Tocta.java index cb08bd86..144f8f0f 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V090Tocta.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/V090Tocta.java @@ -73,11 +73,11 @@ public final class V090Tocta implements BaseNumberTyte { @Override public void fillOctalsByClone(T08PartOctalBaseAppender appender) { - T02PartBinary.forEach(v -> getValue(v).fillOctalsByClone(appender)); + T02PartBinary.PART_1.staticVoorElk(v -> getValue(v).fillOctalsByClone(appender)); } @Override public void fillTytesByReference(V009TyteBaseAppender appender) { - T02PartBinary.forEach(v -> getValue(v).fillTytesByReference(appender)); + T02PartBinary.PART_1.staticVoorElk(v -> getValue(v).fillTytesByReference(appender)); } } diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/VCA8Tath.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/VCA8Tath.java index e9de3e85..400e59de 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/VCA8Tath.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/VCA8Tath.java @@ -43,11 +43,11 @@ public class VCA8Tath implements BaseNumberTyte { @Override public void fillOctalsByClone(T08PartOctalBaseAppender appender) { - T02PartBinary.forEach(v -> getValue(v).fillOctalsByClone(appender)); + T02PartBinary.PART_1.staticVoorElk(v -> getValue(v).fillOctalsByClone(appender)); } @Override public void fillTytesByReference(V009TyteBaseAppender appender) { - T02PartBinary.forEach(v -> getValue(v).fillTytesByReference(appender)); + T02PartBinary.PART_1.staticVoorElk(v -> getValue(v).fillTytesByReference(appender)); } } diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BasePartSplit16.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BasePartSplit16.java deleted file mode 100644 index afdb9d3f..00000000 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BasePartSplit16.java +++ /dev/null @@ -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]; - } -} diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BasePartSplit4.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BasePartSplit4.java deleted file mode 100644 index 2bfd33f8..00000000 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BasePartSplit4.java +++ /dev/null @@ -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]; - } -} diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BasePartSplit6.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BasePartSplit6.java deleted file mode 100644 index 0d684c32..00000000 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BasePartSplit6.java +++ /dev/null @@ -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]; - } -} diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BasePartSplit8.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BasePartSplit8.java deleted file mode 100644 index db216168..00000000 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BasePartSplit8.java +++ /dev/null @@ -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(); - } -} diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBone.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBone.java index 9314c0e4..d8dcb395 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBone.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBone.java @@ -1,17 +1,16 @@ package love.distributedrebirth.numberxd.base2t.bone; +import java.util.Map; +import java.util.stream.Collectors; + /** * * * @author willemtsade ©Δ∞ 仙上主天 */ -public interface BassBone extends BassBoneStore { - - String name(); +public interface BassBone> extends BassBoneEnum, BassBoneStore { - int ordinal(); - - default String staticBoneName() { + default String staticBoneNaam() { return getClass().getAnnotation(BassBoneName.class).value(); } @@ -30,4 +29,22 @@ public interface BassBone extends BassBoneStore { default String getChinaValue() { return getBBC().getString(BassBoneStoreKey.CHINA_VALUE); } + + @SuppressWarnings("unchecked") + default T staticValueOfTone(String identifierTone) { + Map 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 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); + } } diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneAlt1.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneAlt1.java index c6080683..f2b3b6f2 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneAlt1.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneAlt1.java @@ -5,7 +5,7 @@ package love.distributedrebirth.numberxd.base2t.bone; * * @author willemtsade ©Δ∞ 仙上主天 */ -public interface BassBoneAlt1 extends BassBone { +public interface BassBoneAlt1> extends BassBone { default String getAlt1Value() { return getBBC().getString(BassBoneStoreKey.ALT_1_VALUE); diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneAlt2.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneAlt2.java index d5bc4c7f..21ec6b91 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneAlt2.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneAlt2.java @@ -5,7 +5,7 @@ package love.distributedrebirth.numberxd.base2t.bone; * * @author willemtsade ©Δ∞ 仙上主天 */ -public interface BassBoneAlt2 extends BassBoneAlt1 { +public interface BassBoneAlt2> extends BassBoneAlt1 { default String getAlt2Value() { return getBBC().getString(BassBoneStoreKey.ALT_2_VALUE); diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneAlt3.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneAlt3.java index 89305491..fa4aa7f8 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneAlt3.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneAlt3.java @@ -5,7 +5,7 @@ package love.distributedrebirth.numberxd.base2t.bone; * * @author willemtsade ©Δ∞ 仙上主天 */ -public interface BassBoneAlt3 extends BassBoneAlt2 { +public interface BassBoneAlt3> extends BassBoneAlt2 { default String getAlt3Value() { return getBBC().getString(BassBoneStoreKey.ALT_3_VALUE); diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneAlt4.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneAlt4.java index f7033a46..a3b629a2 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneAlt4.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneAlt4.java @@ -5,7 +5,7 @@ package love.distributedrebirth.numberxd.base2t.bone; * * @author willemtsade ©Δ∞ 仙上主天 */ -public interface BassBoneAlt4 extends BassBoneAlt3 { +public interface BassBoneAlt4> extends BassBoneAlt3 { default String getAlt4Value() { return getBBC().getString(BassBoneStoreKey.ALT_4_VALUE); diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneCoffin.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneCoffin.java index cd4f63f8..d592b39a 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneCoffin.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneCoffin.java @@ -24,6 +24,22 @@ public interface BassBoneCoffin { default Boolean getBoolean(BassBoneStoreKey key) { return Boolean.class.cast(get(key)); } + + @SuppressWarnings("unchecked") + default Map getMapObject(BassBoneStoreKey key) { + if (get(key) == null) { + putInit(key, new HashMap<>()); + } + return Map.class.cast(get(key)); + } + + @SuppressWarnings("unchecked") + default Map getMapString(BassBoneStoreKey key) { + if (get(key) == null) { + putInit(key, new HashMap<>()); + } + return Map.class.cast(get(key)); + } static BassBoneCoffin newInstance() { return new BassBoneCoffin() { diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneEnum.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneEnum.java new file mode 100644 index 00000000..3920b78d --- /dev/null +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneEnum.java @@ -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 { + + 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 staticInstancesList() { + return Arrays.asList(staticInstances()); + } + + default Iterator staticInstancesIterator() { + return staticInstancesList().iterator(); + } + + default Stream staticInstancesStream() { + return staticInstancesList().stream(); + } + + default T volgende() { + T[] values = staticInstances(); + int resultIndex = 0; + for (int i=0;i consumer) { + for (T value:staticInstances()) { + consumer.accept(value); + } + } +} diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BasePartShiftBits.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneShiftBits.java similarity index 72% rename from numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BasePartShiftBits.java rename to numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneShiftBits.java index c2652ee5..9d60bbb6 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BasePartShiftBits.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneShiftBits.java @@ -5,7 +5,7 @@ package love.distributedrebirth.numberxd.base2t.bone; * * @author willemtsade ©Δ∞ 仙上主天 */ -public interface BasePartShiftBits extends BassBone { +public interface BassBoneShiftBits> extends BassBone { default Integer getShiftBits() { return getBBC().getInteger(BassBoneStoreKey.SHIFT_BITS); diff --git a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneStoreKey.java b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneStoreKey.java index c059f3d0..1dbbd91b 100644 --- a/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneStoreKey.java +++ b/numberxd/src/main/love/distributedrebirth/numberxd/base2t/bone/BassBoneStoreKey.java @@ -13,6 +13,9 @@ public enum BassBoneStoreKey { CHINA_VALUE, SHIFT_BITS, + MAP_TONE, + MAP_CHINA, + ALT_1_VALUE, ALT_2_VALUE, ALT_3_VALUE, diff --git a/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T02PartBinaryTest.java b/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T02PartBinaryTest.java index 635e9e6f..7ae3652c 100644 --- a/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T02PartBinaryTest.java +++ b/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T02PartBinaryTest.java @@ -22,13 +22,13 @@ public class T02PartBinaryTest { @Test public void testToneMap() { - Assertions.assertEquals(T02PartBinary.PART_1, T02PartBinary.valueOfTone("˧")); - Assertions.assertEquals(T02PartBinary.PART_2, T02PartBinary.valueOfTone("꜔")); + Assertions.assertEquals(T02PartBinary.PART_1, T02PartBinary.PART_1.staticValueOfTone("˧")); + Assertions.assertEquals(T02PartBinary.PART_2, T02PartBinary.PART_1.staticValueOfTone("꜔")); } @Test public void testChinaMap() { - Assertions.assertEquals(T02PartBinary.PART_1, T02PartBinary.valueOfChina("低")); - Assertions.assertEquals(T02PartBinary.PART_2, T02PartBinary.valueOfChina("高")); + Assertions.assertEquals(T02PartBinary.PART_1, T02PartBinary.PART_1.staticValueOfChina("低")); + Assertions.assertEquals(T02PartBinary.PART_2, T02PartBinary.PART_1.staticValueOfChina("高")); } } diff --git a/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T03PartTritTest.java b/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T03PartTritTest.java index 0d5bf014..ee61fbe4 100644 --- a/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T03PartTritTest.java +++ b/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T03PartTritTest.java @@ -22,15 +22,15 @@ public class T03PartTritTest { @Test public void testToneMap() { - Assertions.assertEquals(T03PartTrit.PART_1, T03PartTrit.valueOfTone("˦")); - Assertions.assertEquals(T03PartTrit.PART_2, T03PartTrit.valueOfTone("˧")); - Assertions.assertEquals(T03PartTrit.PART_3, T03PartTrit.valueOfTone("˨")); + Assertions.assertEquals(T03PartTrit.PART_1, T03PartTrit.PART_1.staticValueOfTone("˦")); + Assertions.assertEquals(T03PartTrit.PART_2, T03PartTrit.PART_1.staticValueOfTone("˧")); + Assertions.assertEquals(T03PartTrit.PART_3, T03PartTrit.PART_1.staticValueOfTone("˨")); } @Test public void testChinaMap() { - Assertions.assertEquals(T03PartTrit.PART_1, T03PartTrit.valueOfChina("一")); - Assertions.assertEquals(T03PartTrit.PART_2, T03PartTrit.valueOfChina("二")); - Assertions.assertEquals(T03PartTrit.PART_3, T03PartTrit.valueOfChina("三")); + Assertions.assertEquals(T03PartTrit.PART_1, T03PartTrit.PART_1.staticValueOfChina("一")); + Assertions.assertEquals(T03PartTrit.PART_2, T03PartTrit.PART_1.staticValueOfChina("二")); + Assertions.assertEquals(T03PartTrit.PART_3, T03PartTrit.PART_1.staticValueOfChina("三")); } } diff --git a/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T04PartQuadTest.java b/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T04PartQuadTest.java index d069a4fd..80cc3166 100644 --- a/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T04PartQuadTest.java +++ b/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T04PartQuadTest.java @@ -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 public void testToneMap() { - Assertions.assertEquals(T04PartQuad.PART_1, T04PartQuad.valueOfTone("˥")); - Assertions.assertEquals(T04PartQuad.PART_2, T04PartQuad.valueOfTone("꜒")); - Assertions.assertEquals(T04PartQuad.PART_3, T04PartQuad.valueOfTone("꜖")); - Assertions.assertEquals(T04PartQuad.PART_4, T04PartQuad.valueOfTone("˩")); + Assertions.assertEquals(T04PartQuad.PART_1, T04PartQuad.PART_1.staticValueOfTone("˥")); + Assertions.assertEquals(T04PartQuad.PART_2, T04PartQuad.PART_1.staticValueOfTone("꜒")); + Assertions.assertEquals(T04PartQuad.PART_3, T04PartQuad.PART_1.staticValueOfTone("꜖")); + Assertions.assertEquals(T04PartQuad.PART_4, T04PartQuad.PART_1.staticValueOfTone("˩")); } @Test public void testChinaMap() { - Assertions.assertEquals(T04PartQuad.PART_1, T04PartQuad.valueOfChina("北")); - Assertions.assertEquals(T04PartQuad.PART_2, T04PartQuad.valueOfChina("東")); - Assertions.assertEquals(T04PartQuad.PART_3, T04PartQuad.valueOfChina("西")); - Assertions.assertEquals(T04PartQuad.PART_4, T04PartQuad.valueOfChina("南")); + Assertions.assertEquals(T04PartQuad.PART_1, T04PartQuad.PART_1.staticValueOfChina("北")); + Assertions.assertEquals(T04PartQuad.PART_2, T04PartQuad.PART_1.staticValueOfChina("東")); + Assertions.assertEquals(T04PartQuad.PART_3, T04PartQuad.PART_1.staticValueOfChina("西")); + Assertions.assertEquals(T04PartQuad.PART_4, T04PartQuad.PART_1.staticValueOfChina("南")); } } diff --git a/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T05PartPentalTest.java b/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T05PartPentalTest.java index dc556419..6229faa9 100644 --- a/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T05PartPentalTest.java +++ b/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T05PartPentalTest.java @@ -22,19 +22,19 @@ public class T05PartPentalTest { @Test public void testToneMap() { - Assertions.assertEquals(T05PartPental.PART_1, T05PartPental.valueOfTone("˥")); - Assertions.assertEquals(T05PartPental.PART_2, T05PartPental.valueOfTone("˦")); - Assertions.assertEquals(T05PartPental.PART_3, T05PartPental.valueOfTone("˧")); - Assertions.assertEquals(T05PartPental.PART_4, T05PartPental.valueOfTone("˨")); - Assertions.assertEquals(T05PartPental.PART_5, T05PartPental.valueOfTone("˩")); + Assertions.assertEquals(T05PartPental.PART_1, T05PartPental.PART_1.staticValueOfTone("˥")); + Assertions.assertEquals(T05PartPental.PART_2, T05PartPental.PART_1.staticValueOfTone("˦")); + Assertions.assertEquals(T05PartPental.PART_3, T05PartPental.PART_1.staticValueOfTone("˧")); + Assertions.assertEquals(T05PartPental.PART_4, T05PartPental.PART_1.staticValueOfTone("˨")); + Assertions.assertEquals(T05PartPental.PART_5, T05PartPental.PART_1.staticValueOfTone("˩")); } @Test public void testChinaMap() { - Assertions.assertEquals(T05PartPental.PART_1, T05PartPental.valueOfChina("火")); - Assertions.assertEquals(T05PartPental.PART_2, T05PartPental.valueOfChina("水")); - Assertions.assertEquals(T05PartPental.PART_3, T05PartPental.valueOfChina("木")); - Assertions.assertEquals(T05PartPental.PART_4, T05PartPental.valueOfChina("金")); - Assertions.assertEquals(T05PartPental.PART_5, T05PartPental.valueOfChina("土")); + Assertions.assertEquals(T05PartPental.PART_1, T05PartPental.PART_1.staticValueOfChina("火")); + Assertions.assertEquals(T05PartPental.PART_2, T05PartPental.PART_1.staticValueOfChina("水")); + Assertions.assertEquals(T05PartPental.PART_3, T05PartPental.PART_1.staticValueOfChina("木")); + Assertions.assertEquals(T05PartPental.PART_4, T05PartPental.PART_1.staticValueOfChina("金")); + Assertions.assertEquals(T05PartPental.PART_5, T05PartPental.PART_1.staticValueOfChina("土")); } } diff --git a/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T06PartSeximalTest.java b/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T06PartSeximalTest.java index ed78e688..116b7131 100644 --- a/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T06PartSeximalTest.java +++ b/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T06PartSeximalTest.java @@ -25,17 +25,17 @@ public class T06PartSeximalTest { @Test public void testToneMap() { - Assertions.assertEquals(T06PartSeximal.PART_1, T06PartSeximal.valueOfTone("˦")); - Assertions.assertEquals(T06PartSeximal.PART_2, T06PartSeximal.valueOfTone("˨")); - Assertions.assertEquals(T06PartSeximal.PART_5, T06PartSeximal.valueOfTone("꜊")); - Assertions.assertEquals(T06PartSeximal.PART_6, T06PartSeximal.valueOfTone("꜏")); + Assertions.assertEquals(T06PartSeximal.PART_1, T06PartSeximal.PART_1.staticValueOfTone("˦")); + Assertions.assertEquals(T06PartSeximal.PART_2, T06PartSeximal.PART_1.staticValueOfTone("˨")); + Assertions.assertEquals(T06PartSeximal.PART_5, T06PartSeximal.PART_1.staticValueOfTone("꜊")); + Assertions.assertEquals(T06PartSeximal.PART_6, T06PartSeximal.PART_1.staticValueOfTone("꜏")); } @Test public void testChinaMap() { - Assertions.assertEquals(T06PartSeximal.PART_1, T06PartSeximal.valueOfChina("四")); - Assertions.assertEquals(T06PartSeximal.PART_2, T06PartSeximal.valueOfChina("五")); - Assertions.assertEquals(T06PartSeximal.PART_5, T06PartSeximal.valueOfChina("八")); - Assertions.assertEquals(T06PartSeximal.PART_6, T06PartSeximal.valueOfChina("九")); + Assertions.assertEquals(T06PartSeximal.PART_1, T06PartSeximal.PART_1.staticValueOfChina("四")); + Assertions.assertEquals(T06PartSeximal.PART_2, T06PartSeximal.PART_1.staticValueOfChina("五")); + Assertions.assertEquals(T06PartSeximal.PART_5, T06PartSeximal.PART_1.staticValueOfChina("八")); + Assertions.assertEquals(T06PartSeximal.PART_6, T06PartSeximal.PART_1.staticValueOfChina("九")); } } diff --git a/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T07PartPlanItTest.java b/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T07PartPlanItTest.java index 4e6dbe03..b21d9220 100644 --- a/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T07PartPlanItTest.java +++ b/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T07PartPlanItTest.java @@ -25,17 +25,17 @@ public class T07PartPlanItTest { @Test public void testToneMap() { - Assertions.assertEquals(T07PartPlanIt.PART_1, T07PartPlanIt.valueOfTone("˥")); - Assertions.assertEquals(T07PartPlanIt.PART_2, T07PartPlanIt.valueOfTone("꜉")); - Assertions.assertEquals(T07PartPlanIt.PART_6, T07PartPlanIt.valueOfTone("꜐")); - Assertions.assertEquals(T07PartPlanIt.PART_7, T07PartPlanIt.valueOfTone("˩")); + Assertions.assertEquals(T07PartPlanIt.PART_1, T07PartPlanIt.PART_1.staticValueOfTone("˥")); + Assertions.assertEquals(T07PartPlanIt.PART_2, T07PartPlanIt.PART_1.staticValueOfTone("꜉")); + Assertions.assertEquals(T07PartPlanIt.PART_6, T07PartPlanIt.PART_1.staticValueOfTone("꜐")); + Assertions.assertEquals(T07PartPlanIt.PART_7, T07PartPlanIt.PART_1.staticValueOfTone("˩")); } @Test public void testChinaMap() { - Assertions.assertEquals(T07PartPlanIt.PART_1, T07PartPlanIt.valueOfChina("♎︎")); - Assertions.assertEquals(T07PartPlanIt.PART_2, T07PartPlanIt.valueOfChina("♏︎")); - Assertions.assertEquals(T07PartPlanIt.PART_6, T07PartPlanIt.valueOfChina("♑︎")); - Assertions.assertEquals(T07PartPlanIt.PART_7, T07PartPlanIt.valueOfChina("♈︎")); + Assertions.assertEquals(T07PartPlanIt.PART_1, T07PartPlanIt.PART_1.staticValueOfChina("♎︎")); + Assertions.assertEquals(T07PartPlanIt.PART_2, T07PartPlanIt.PART_1.staticValueOfChina("♏︎")); + Assertions.assertEquals(T07PartPlanIt.PART_6, T07PartPlanIt.PART_1.staticValueOfChina("♑︎")); + Assertions.assertEquals(T07PartPlanIt.PART_7, T07PartPlanIt.PART_1.staticValueOfChina("♈︎")); } } diff --git a/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T08PartOctalTest.java b/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T08PartOctalTest.java index 1a09a4b2..2597f7fe 100644 --- a/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T08PartOctalTest.java +++ b/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T08PartOctalTest.java @@ -28,17 +28,17 @@ public class T08PartOctalTest { @Test public void testToneMap() { - Assertions.assertEquals(T08PartOctal.PART_1, T08PartOctal.valueOfTone("˥")); - Assertions.assertEquals(T08PartOctal.PART_2, T08PartOctal.valueOfTone("˩")); - Assertions.assertEquals(T08PartOctal.PART_7, T08PartOctal.valueOfTone("꜍")); - Assertions.assertEquals(T08PartOctal.PART_8, T08PartOctal.valueOfTone("꜑")); + Assertions.assertEquals(T08PartOctal.PART_1, T08PartOctal.PART_1.staticValueOfTone("˥")); + Assertions.assertEquals(T08PartOctal.PART_2, T08PartOctal.PART_1.staticValueOfTone("˩")); + Assertions.assertEquals(T08PartOctal.PART_7, T08PartOctal.PART_1.staticValueOfTone("꜍")); + Assertions.assertEquals(T08PartOctal.PART_8, T08PartOctal.PART_1.staticValueOfTone("꜑")); } @Test public void testChinaMap() { - Assertions.assertEquals(T08PartOctal.PART_1, T08PartOctal.valueOfChina("心")); - Assertions.assertEquals(T08PartOctal.PART_2, T08PartOctal.valueOfChina("頭")); - Assertions.assertEquals(T08PartOctal.PART_7, T08PartOctal.valueOfChina("肢")); - Assertions.assertEquals(T08PartOctal.PART_8, T08PartOctal.valueOfChina("腳")); + Assertions.assertEquals(T08PartOctal.PART_1, T08PartOctal.PART_1.staticValueOfChina("心")); + Assertions.assertEquals(T08PartOctal.PART_2, T08PartOctal.PART_1.staticValueOfChina("頭")); + Assertions.assertEquals(T08PartOctal.PART_7, T08PartOctal.PART_1.staticValueOfChina("肢")); + Assertions.assertEquals(T08PartOctal.PART_8, T08PartOctal.PART_1.staticValueOfChina("腳")); } } diff --git a/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T10PartDecimalTest.java b/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T10PartDecimalTest.java index 122bcbeb..576ffcf8 100644 --- a/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T10PartDecimalTest.java +++ b/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T10PartDecimalTest.java @@ -22,17 +22,17 @@ public class T10PartDecimalTest { @Test public void testToneMap() { - Assertions.assertEquals(T10PartDecimal.PART_1, T10PartDecimal.valueOfTone("˥")); - Assertions.assertEquals(T10PartDecimal.PART_2, T10PartDecimal.valueOfTone("˦")); - Assertions.assertEquals(T10PartDecimal.PART_9, T10PartDecimal.valueOfTone("꜕")); - Assertions.assertEquals(T10PartDecimal.PART_10, T10PartDecimal.valueOfTone("꜖")); + Assertions.assertEquals(T10PartDecimal.PART_1, T10PartDecimal.PART_1.staticValueOfTone("˥")); + Assertions.assertEquals(T10PartDecimal.PART_2, T10PartDecimal.PART_1.staticValueOfTone("˦")); + Assertions.assertEquals(T10PartDecimal.PART_9, T10PartDecimal.PART_1.staticValueOfTone("꜕")); + Assertions.assertEquals(T10PartDecimal.PART_10, T10PartDecimal.PART_1.staticValueOfTone("꜖")); } @Test public void testChinaMap() { - Assertions.assertEquals(T10PartDecimal.PART_1, T10PartDecimal.valueOfChina("零")); - Assertions.assertEquals(T10PartDecimal.PART_2, T10PartDecimal.valueOfChina("壹")); - Assertions.assertEquals(T10PartDecimal.PART_9, T10PartDecimal.valueOfChina("捌")); - Assertions.assertEquals(T10PartDecimal.PART_10, T10PartDecimal.valueOfChina("玖")); + Assertions.assertEquals(T10PartDecimal.PART_1, T10PartDecimal.PART_1.staticValueOfChina("零")); + Assertions.assertEquals(T10PartDecimal.PART_2, T10PartDecimal.PART_1.staticValueOfChina("壹")); + Assertions.assertEquals(T10PartDecimal.PART_9, T10PartDecimal.PART_1.staticValueOfChina("捌")); + Assertions.assertEquals(T10PartDecimal.PART_10, T10PartDecimal.PART_1.staticValueOfChina("玖")); } } diff --git a/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T11PartUndecimalTest.java b/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T11PartUndecimalTest.java index 936290d3..8e79c04f 100644 --- a/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T11PartUndecimalTest.java +++ b/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T11PartUndecimalTest.java @@ -22,17 +22,17 @@ public class T11PartUndecimalTest { @Test public void testToneMap() { - Assertions.assertEquals(T11PartUndecimal.PART_1, T11PartUndecimal.valueOfTone("˥")); - Assertions.assertEquals(T11PartUndecimal.PART_2, T11PartUndecimal.valueOfTone("꜈")); - Assertions.assertEquals(T11PartUndecimal.PART_10, T11PartUndecimal.valueOfTone("꜐")); - Assertions.assertEquals(T11PartUndecimal.PART_11, T11PartUndecimal.valueOfTone("˩")); + Assertions.assertEquals(T11PartUndecimal.PART_1, T11PartUndecimal.PART_1.staticValueOfTone("˥")); + Assertions.assertEquals(T11PartUndecimal.PART_2, T11PartUndecimal.PART_1.staticValueOfTone("꜈")); + Assertions.assertEquals(T11PartUndecimal.PART_10, T11PartUndecimal.PART_1.staticValueOfTone("꜐")); + Assertions.assertEquals(T11PartUndecimal.PART_11, T11PartUndecimal.PART_1.staticValueOfTone("˩")); } @Test public void testChinaMap() { - Assertions.assertEquals(T11PartUndecimal.PART_1, T11PartUndecimal.valueOfChina("走")); - Assertions.assertEquals(T11PartUndecimal.PART_2, T11PartUndecimal.valueOfChina("跑")); - Assertions.assertEquals(T11PartUndecimal.PART_10, T11PartUndecimal.valueOfChina("春")); - Assertions.assertEquals(T11PartUndecimal.PART_11, T11PartUndecimal.valueOfChina("耦")); + Assertions.assertEquals(T11PartUndecimal.PART_1, T11PartUndecimal.PART_1.staticValueOfChina("走")); + Assertions.assertEquals(T11PartUndecimal.PART_2, T11PartUndecimal.PART_1.staticValueOfChina("跑")); + Assertions.assertEquals(T11PartUndecimal.PART_10, T11PartUndecimal.PART_1.staticValueOfChina("春")); + Assertions.assertEquals(T11PartUndecimal.PART_11, T11PartUndecimal.PART_1.staticValueOfChina("耦")); } } diff --git a/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T12PartUncialTest.java b/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T12PartUncialTest.java index 6d8ae03b..d46072e4 100644 --- a/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T12PartUncialTest.java +++ b/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T12PartUncialTest.java @@ -25,17 +25,17 @@ public class T12PartUncialTest { @Test public void testToneMap() { - Assertions.assertEquals(T12PartUncial.PART_1, T12PartUncial.valueOfTone("˥")); - Assertions.assertEquals(T12PartUncial.PART_2, T12PartUncial.valueOfTone("˧")); - Assertions.assertEquals(T12PartUncial.PART_11, T12PartUncial.valueOfTone("꜏")); - Assertions.assertEquals(T12PartUncial.PART_12, T12PartUncial.valueOfTone("꜑")); + Assertions.assertEquals(T12PartUncial.PART_1, T12PartUncial.PART_1.staticValueOfTone("˥")); + Assertions.assertEquals(T12PartUncial.PART_2, T12PartUncial.PART_1.staticValueOfTone("˧")); + Assertions.assertEquals(T12PartUncial.PART_11, T12PartUncial.PART_1.staticValueOfTone("꜏")); + Assertions.assertEquals(T12PartUncial.PART_12, T12PartUncial.PART_1.staticValueOfTone("꜑")); } @Test public void testChinaMap() { - Assertions.assertEquals(T12PartUncial.PART_1, T12PartUncial.valueOfChina("日")); - Assertions.assertEquals(T12PartUncial.PART_2, T12PartUncial.valueOfChina("月")); - Assertions.assertEquals(T12PartUncial.PART_11, T12PartUncial.valueOfChina("黼")); - Assertions.assertEquals(T12PartUncial.PART_12, T12PartUncial.valueOfChina("亞")); + Assertions.assertEquals(T12PartUncial.PART_1, T12PartUncial.PART_1.staticValueOfChina("日")); + Assertions.assertEquals(T12PartUncial.PART_2, T12PartUncial.PART_1.staticValueOfChina("月")); + Assertions.assertEquals(T12PartUncial.PART_11, T12PartUncial.PART_1.staticValueOfChina("黼")); + Assertions.assertEquals(T12PartUncial.PART_12, T12PartUncial.PART_1.staticValueOfChina("亞")); } } diff --git a/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T16PartHexTest.java b/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T16PartHexTest.java index 5fda3c2a..896b87be 100644 --- a/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T16PartHexTest.java +++ b/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T16PartHexTest.java @@ -25,17 +25,17 @@ public class T16PartHexTest { @Test public void testToneMap() { - Assertions.assertEquals(T16PartHex.PART_1, T16PartHex.valueOfTone("˥")); - Assertions.assertEquals(T16PartHex.PART_2, T16PartHex.valueOfTone("˦")); - Assertions.assertEquals(T16PartHex.PART_15, T16PartHex.valueOfTone("꜐")); - Assertions.assertEquals(T16PartHex.PART_16, T16PartHex.valueOfTone("꜑")); + Assertions.assertEquals(T16PartHex.PART_1, T16PartHex.PART_1.staticValueOfTone("˥")); + Assertions.assertEquals(T16PartHex.PART_2, T16PartHex.PART_1.staticValueOfTone("˦")); + Assertions.assertEquals(T16PartHex.PART_15, T16PartHex.PART_1.staticValueOfTone("꜐")); + Assertions.assertEquals(T16PartHex.PART_16, T16PartHex.PART_1.staticValueOfTone("꜑")); } @Test public void testChinaMap() { - Assertions.assertEquals(T16PartHex.PART_1, T16PartHex.valueOfChina("氫")); - Assertions.assertEquals(T16PartHex.PART_2, T16PartHex.valueOfChina("氦")); - Assertions.assertEquals(T16PartHex.PART_15, T16PartHex.valueOfChina("磷")); - Assertions.assertEquals(T16PartHex.PART_16, T16PartHex.valueOfChina("硫")); + Assertions.assertEquals(T16PartHex.PART_1, T16PartHex.PART_1.staticValueOfChina("氫")); + Assertions.assertEquals(T16PartHex.PART_2, T16PartHex.PART_1.staticValueOfChina("氦")); + Assertions.assertEquals(T16PartHex.PART_15, T16PartHex.PART_1.staticValueOfChina("磷")); + Assertions.assertEquals(T16PartHex.PART_16, T16PartHex.PART_1.staticValueOfChina("硫")); } } diff --git a/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T20PartScoreTest.java b/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T20PartScoreTest.java index 635a5f8c..35bd4be0 100644 --- a/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T20PartScoreTest.java +++ b/numberxd/src/test/love/distributedrebirth/numberxd/base2t/T20PartScoreTest.java @@ -25,25 +25,25 @@ public class T20PartScoreTest { @Test public void testToneMap() { - Assertions.assertEquals(T20PartScore.PART_1, T20PartScore.valueOfTone("˥")); - Assertions.assertEquals(T20PartScore.PART_2, T20PartScore.valueOfTone("˦")); - Assertions.assertEquals(T20PartScore.PART_19, T20PartScore.valueOfTone("꜐")); - Assertions.assertEquals(T20PartScore.PART_20, T20PartScore.valueOfTone("꜑")); + Assertions.assertEquals(T20PartScore.PART_1, T20PartScore.PART_1.staticValueOfTone("˥")); + Assertions.assertEquals(T20PartScore.PART_2, T20PartScore.PART_1.staticValueOfTone("˦")); + Assertions.assertEquals(T20PartScore.PART_19, T20PartScore.PART_1.staticValueOfTone("꜐")); + Assertions.assertEquals(T20PartScore.PART_20, T20PartScore.PART_1.staticValueOfTone("꜑")); } @Test public void testChinaMap() { - Assertions.assertEquals(T20PartScore.PART_1, T20PartScore.valueOfChina("尧")); - Assertions.assertEquals(T20PartScore.PART_2, T20PartScore.valueOfChina("泽")); - Assertions.assertEquals(T20PartScore.PART_19, T20PartScore.valueOfChina("仄")); - Assertions.assertEquals(T20PartScore.PART_20, T20PartScore.valueOfChina("幺")); + Assertions.assertEquals(T20PartScore.PART_1, T20PartScore.PART_1.staticValueOfChina("尧")); + Assertions.assertEquals(T20PartScore.PART_2, T20PartScore.PART_1.staticValueOfChina("泽")); + Assertions.assertEquals(T20PartScore.PART_19, T20PartScore.PART_1.staticValueOfChina("仄")); + Assertions.assertEquals(T20PartScore.PART_20, T20PartScore.PART_1.staticValueOfChina("幺")); } @Test public void testOpenLCMap() { - Assertions.assertEquals(T20PartScore.PART_1, T20PartScore.valueOfOpenLC("2")); - Assertions.assertEquals(T20PartScore.PART_2, T20PartScore.valueOfOpenLC("3")); - Assertions.assertEquals(T20PartScore.PART_19, T20PartScore.valueOfOpenLC("W")); - Assertions.assertEquals(T20PartScore.PART_20, T20PartScore.valueOfOpenLC("X")); + Assertions.assertEquals(T20PartScore.PART_1, T20PartScore.PART_1.staticValueOfOpenLC("2")); + Assertions.assertEquals(T20PartScore.PART_2, T20PartScore.PART_1.staticValueOfOpenLC("3")); + Assertions.assertEquals(T20PartScore.PART_19, T20PartScore.PART_1.staticValueOfOpenLC("W")); + Assertions.assertEquals(T20PartScore.PART_20, T20PartScore.PART_1.staticValueOfOpenLC("X")); } }