Converted last T model
This commit is contained in:
parent
01a37a1496
commit
cbd2d75c5f
|
@ -10,7 +10,7 @@ public final class BasePartFactory {
|
||||||
return SUPPORTED_BASES;
|
return SUPPORTED_BASES;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static BassBone[] buildBassBonesByBase(int base) {
|
public static BassBone<?>[] buildBassBonesByBase(int base) {
|
||||||
switch (base) {
|
switch (base) {
|
||||||
case 2:
|
case 2:
|
||||||
return T02PartBinary.values();
|
return T02PartBinary.values();
|
||||||
|
|
|
@ -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("T60Sexagesimal")
|
@BassBoneName("T60Sexagesimal")
|
||||||
public enum T60Sexagesimal implements BassBone {
|
public enum T60Sexagesimal implements BassBone<T60Sexagesimal> {
|
||||||
|
|
||||||
PART_1 ("˧˩˥","ια","牛","cow"),
|
PART_1 ("˧˩˥","ια","牛","cow"),
|
||||||
PART_2 ("˧˥˦","ιβ","鸡","chicken"),
|
PART_2 ("˧˥˦","ιβ","鸡","chicken"),
|
||||||
|
@ -85,35 +79,19 @@ public enum T60Sexagesimal implements BassBone {
|
||||||
;
|
;
|
||||||
|
|
||||||
public static int LENGTH() { return values().length; };
|
public static int LENGTH() { return values().length; };
|
||||||
private final BassBoneCoffin bfm = BassBoneCoffin.newInstance();
|
private final BassBoneCoffin bbc = BassBoneCoffin.newInstance();
|
||||||
private static final Map<String, T60Sexagesimal> TONE_MAP = Collections.unmodifiableMap(
|
|
||||||
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v)));
|
|
||||||
private static final Map<String, T60Sexagesimal> CHINA_MAP = Collections.unmodifiableMap(
|
|
||||||
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getChinaKey(), v -> v)));
|
|
||||||
|
|
||||||
private T60Sexagesimal(String idTone, String idLetter, String chinaKey, String chinaValue) {
|
private T60Sexagesimal(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 bfm;
|
return bbc;
|
||||||
}
|
|
||||||
|
|
||||||
public static void forEach(Consumer<T60Sexagesimal> consumer) {
|
|
||||||
for (T60Sexagesimal value:values()) {
|
|
||||||
consumer.accept(value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static T60Sexagesimal valueOfTone(String identifierTone) {
|
|
||||||
return TONE_MAP.get(identifierTone);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static T60Sexagesimal valueOfChina(String chinaKey) {
|
|
||||||
return CHINA_MAP.get(chinaKey);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,11 +42,11 @@ public class V654Triz implements BaseNumberTyte<V654Triz> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
|
public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
|
||||||
T60Sexagesimal.forEach(v -> getValue(v).fillOctalsByClone(appender));
|
T60Sexagesimal.PART_1.staticVoorElk(v -> getValue(v).fillOctalsByClone(appender));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void fillTytesByReference(V009TyteBaseAppender appender) {
|
public void fillTytesByReference(V009TyteBaseAppender appender) {
|
||||||
T60Sexagesimal.forEach(v -> getValue(v).fillTytesByReference(appender));
|
T60Sexagesimal.PART_1.staticVoorElk(v -> getValue(v).fillTytesByReference(appender));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,6 +42,6 @@ public class V9D8Traz implements BaseNumber<V9D8Traz> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
|
public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
|
||||||
T60Sexagesimal.forEach(v -> getValue(v).fillOctalsByClone(appender));
|
T60Sexagesimal.PART_1.staticVoorElk(v -> getValue(v).fillOctalsByClone(appender));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,17 +22,17 @@ public class T60SexagesimalTest {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testToneMap() {
|
public void testToneMap() {
|
||||||
Assertions.assertEquals(T60Sexagesimal.PART_1, T60Sexagesimal.valueOfTone("˧˩˥"));
|
Assertions.assertEquals(T60Sexagesimal.PART_1, T60Sexagesimal.PART_1.staticValueOfTone("˧˩˥"));
|
||||||
Assertions.assertEquals(T60Sexagesimal.PART_2, T60Sexagesimal.valueOfTone("˧˥˦"));
|
Assertions.assertEquals(T60Sexagesimal.PART_2, T60Sexagesimal.PART_1.staticValueOfTone("˧˥˦"));
|
||||||
Assertions.assertEquals(T60Sexagesimal.PART_59, T60Sexagesimal.valueOfTone("꜍꜍꜏"));
|
Assertions.assertEquals(T60Sexagesimal.PART_59, T60Sexagesimal.PART_1.staticValueOfTone("꜍꜍꜏"));
|
||||||
Assertions.assertEquals(T60Sexagesimal.PART_60, T60Sexagesimal.valueOfTone("꜑꜑꜏"));
|
Assertions.assertEquals(T60Sexagesimal.PART_60, T60Sexagesimal.PART_1.staticValueOfTone("꜑꜑꜏"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testChinaMap() {
|
public void testChinaMap() {
|
||||||
Assertions.assertEquals(T60Sexagesimal.PART_1, T60Sexagesimal.valueOfChina("牛"));
|
Assertions.assertEquals(T60Sexagesimal.PART_1, T60Sexagesimal.PART_1.staticValueOfChina("牛"));
|
||||||
Assertions.assertEquals(T60Sexagesimal.PART_2, T60Sexagesimal.valueOfChina("鸡"));
|
Assertions.assertEquals(T60Sexagesimal.PART_2, T60Sexagesimal.PART_1.staticValueOfChina("鸡"));
|
||||||
Assertions.assertEquals(T60Sexagesimal.PART_59, T60Sexagesimal.valueOfChina("薯"));
|
Assertions.assertEquals(T60Sexagesimal.PART_59, T60Sexagesimal.PART_1.staticValueOfChina("薯"));
|
||||||
Assertions.assertEquals(T60Sexagesimal.PART_60, T60Sexagesimal.valueOfChina("蘋"));
|
Assertions.assertEquals(T60Sexagesimal.PART_60, T60Sexagesimal.PART_1.staticValueOfChina("蘋"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue