Split enum into set and uppercased bbc paths.

This commit is contained in:
Willem Cazander 2022-02-01 23:33:23 +01:00
parent 201f8f7ae3
commit caf31e2f96
23 changed files with 215 additions and 210 deletions

View file

@ -21,16 +21,16 @@ public enum T02PartBinary implements BassBone<T02PartBinary> {
private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); private final BassBoneCoffin bbc = BassBoneCoffin.newInstance();
private T02PartBinary(String idTone, String idLetter, String chinaKey, String chinaValue) { private T02PartBinary(String idTone, String idLetter, String chinaKey, String chinaValue) {
getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); GET_BBC().PUT_INIT(BassBoneStoreKey.ID_TONE, idTone);
getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); GET_BBC().PUT_INIT(BassBoneStoreKey.ID_LETTER, idLetter);
getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); GET_BBC().PUT_INIT(BassBoneStoreKey.CHINA_KEY, chinaKey);
getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); GET_BBC().PUT_INIT(BassBoneStoreKey.CHINA_VALUE, chinaValue);
getBBC().getMapObject(BassBoneStoreKey.MAP_TONE); GET_BBC().GET_MAP_OBJ(BassBoneStoreKey.MAP_TONE);
getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA); GET_BBC().GET_MAP_OBJ(BassBoneStoreKey.MAP_CHINA);
} }
@Override @Override
public BassBoneCoffin getBBC() { public BassBoneCoffin GET_BBC() {
return bbc; return bbc;
} }
} }

View file

@ -22,16 +22,16 @@ public enum T03PartTrit implements BassBone<T03PartTrit> {
private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); private final BassBoneCoffin bbc = BassBoneCoffin.newInstance();
private T03PartTrit(String idTone, String idLetter, String chinaKey, String chinaValue) { private T03PartTrit(String idTone, String idLetter, String chinaKey, String chinaValue) {
getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); GET_BBC().PUT_INIT(BassBoneStoreKey.ID_TONE, idTone);
getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); GET_BBC().PUT_INIT(BassBoneStoreKey.ID_LETTER, idLetter);
getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); GET_BBC().PUT_INIT(BassBoneStoreKey.CHINA_KEY, chinaKey);
getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); GET_BBC().PUT_INIT(BassBoneStoreKey.CHINA_VALUE, chinaValue);
getBBC().getMapObject(BassBoneStoreKey.MAP_TONE); GET_BBC().GET_MAP_OBJ(BassBoneStoreKey.MAP_TONE);
getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA); GET_BBC().GET_MAP_OBJ(BassBoneStoreKey.MAP_CHINA);
} }
@Override @Override
public BassBoneCoffin getBBC() { public BassBoneCoffin GET_BBC() {
return bbc; return bbc;
} }
} }

View file

@ -25,17 +25,17 @@ public enum T04PartQuad implements BassBoneAlt1<T04PartQuad> {
private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); private final BassBoneCoffin bbc = BassBoneCoffin.newInstance();
private T04PartQuad(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) { private T04PartQuad(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) {
getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); GET_BBC().PUT_INIT(BassBoneStoreKey.ID_TONE, idTone);
getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); GET_BBC().PUT_INIT(BassBoneStoreKey.ID_LETTER, idLetter);
getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); GET_BBC().PUT_INIT(BassBoneStoreKey.CHINA_KEY, chinaKey);
getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); GET_BBC().PUT_INIT(BassBoneStoreKey.CHINA_VALUE, chinaValue);
getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); GET_BBC().PUT_INIT(BassBoneStoreKey.ALT_1_VALUE, alt1Value);
getBBC().getMapObject(BassBoneStoreKey.MAP_TONE); GET_BBC().GET_MAP_OBJ(BassBoneStoreKey.MAP_TONE);
getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA); GET_BBC().GET_MAP_OBJ(BassBoneStoreKey.MAP_CHINA);
} }
@Override @Override
public BassBoneCoffin getBBC() { public BassBoneCoffin GET_BBC() {
return bbc; return bbc;
} }

View file

@ -24,22 +24,18 @@ public enum T05PartPental implements BassBoneAlt2<T05PartPental> {
PART_5("˩","4","","earth","G", "gaia"), PART_5("˩","4","","earth","G", "gaia"),
; ;
public BassBoneCoffin GET_BBC() { return bbc; }
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 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) {
getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); GET_BBC().PUT_INIT(BassBoneStoreKey.ID_TONE, idTone);
getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); GET_BBC().PUT_INIT(BassBoneStoreKey.ID_LETTER, idLetter);
getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); GET_BBC().PUT_INIT(BassBoneStoreKey.CHINA_KEY, chinaKey);
getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); GET_BBC().PUT_INIT(BassBoneStoreKey.CHINA_VALUE, chinaValue);
getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); GET_BBC().PUT_INIT(BassBoneStoreKey.ALT_1_VALUE, alt1Value);
getBBC().putInit(BassBoneStoreKey.ALT_2_VALUE, alt2Value); GET_BBC().PUT_INIT(BassBoneStoreKey.ALT_2_VALUE, alt2Value);
getBBC().getMapObject(BassBoneStoreKey.MAP_TONE); GET_BBC().GET_MAP_OBJ(BassBoneStoreKey.MAP_TONE);
getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA); GET_BBC().GET_MAP_OBJ(BassBoneStoreKey.MAP_CHINA);
}
@Override
public BassBoneCoffin getBBC() {
return bbc;
} }
} }

View file

@ -29,17 +29,17 @@ public enum T06PartSeximal implements BassBoneAlt1<T06PartSeximal> {
private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); private final BassBoneCoffin bbc = BassBoneCoffin.newInstance();
private T06PartSeximal(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) { private T06PartSeximal(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) {
getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); GET_BBC().PUT_INIT(BassBoneStoreKey.ID_TONE, idTone);
getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); GET_BBC().PUT_INIT(BassBoneStoreKey.ID_LETTER, idLetter);
getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); GET_BBC().PUT_INIT(BassBoneStoreKey.CHINA_KEY, chinaKey);
getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); GET_BBC().PUT_INIT(BassBoneStoreKey.CHINA_VALUE, chinaValue);
getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); GET_BBC().PUT_INIT(BassBoneStoreKey.ALT_1_VALUE, alt1Value);
getBBC().getMapObject(BassBoneStoreKey.MAP_TONE); GET_BBC().GET_MAP_OBJ(BassBoneStoreKey.MAP_TONE);
getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA); GET_BBC().GET_MAP_OBJ(BassBoneStoreKey.MAP_CHINA);
} }
@Override @Override
public BassBoneCoffin getBBC() { public BassBoneCoffin GET_BBC() {
return bbc; return bbc;
} }

View file

@ -28,17 +28,17 @@ public enum T07PartPlanIt implements BassBoneAlt1<T07PartPlanIt> {
private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); private final BassBoneCoffin bbc = BassBoneCoffin.newInstance();
private T07PartPlanIt(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) { private T07PartPlanIt(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) {
getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); GET_BBC().PUT_INIT(BassBoneStoreKey.ID_TONE, idTone);
getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); GET_BBC().PUT_INIT(BassBoneStoreKey.ID_LETTER, idLetter);
getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); GET_BBC().PUT_INIT(BassBoneStoreKey.CHINA_KEY, chinaKey);
getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); GET_BBC().PUT_INIT(BassBoneStoreKey.CHINA_VALUE, chinaValue);
getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); GET_BBC().PUT_INIT(BassBoneStoreKey.ALT_1_VALUE, alt1Value);
getBBC().getMapObject(BassBoneStoreKey.MAP_TONE); GET_BBC().GET_MAP_OBJ(BassBoneStoreKey.MAP_TONE);
getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA); GET_BBC().GET_MAP_OBJ(BassBoneStoreKey.MAP_CHINA);
} }
@Override @Override
public BassBoneCoffin getBBC() { public BassBoneCoffin GET_BBC() {
return bbc; return bbc;
} }
} }

View file

@ -34,19 +34,19 @@ public enum T08PartOctal implements BassBoneAlt2<T08PartOctal>,BassBoneShiftBits
private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); private final BassBoneCoffin bbc = BassBoneCoffin.newInstance();
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) {
getBBC().putInit(BassBoneStoreKey.ID_TONE, identifierTone); GET_BBC().PUT_INIT(BassBoneStoreKey.ID_TONE, identifierTone);
getBBC().putInit(BassBoneStoreKey.ID_LETTER, identifierLetter); GET_BBC().PUT_INIT(BassBoneStoreKey.ID_LETTER, identifierLetter);
getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); GET_BBC().PUT_INIT(BassBoneStoreKey.CHINA_KEY, chinaKey);
getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); GET_BBC().PUT_INIT(BassBoneStoreKey.CHINA_VALUE, chinaValue);
getBBC().putInit(BassBoneStoreKey.SHIFT_BITS, Integer.valueOf(shiftBits)); GET_BBC().PUT_INIT(BassBoneStoreKey.SHIFT_BITS, Integer.valueOf(shiftBits));
getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); GET_BBC().PUT_INIT(BassBoneStoreKey.ALT_1_VALUE, alt1Value);
getBBC().putInit(BassBoneStoreKey.ALT_2_VALUE, alt2Value); GET_BBC().PUT_INIT(BassBoneStoreKey.ALT_2_VALUE, alt2Value);
getBBC().getMapObject(BassBoneStoreKey.MAP_TONE); GET_BBC().GET_MAP_OBJ(BassBoneStoreKey.MAP_TONE);
getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA); GET_BBC().GET_MAP_OBJ(BassBoneStoreKey.MAP_CHINA);
} }
@Override @Override
public BassBoneCoffin getBBC() { public BassBoneCoffin GET_BBC() {
return bbc; return bbc;
} }

View file

@ -38,20 +38,20 @@ public enum T10PartDecimal implements BassBoneAlt4<T10PartDecimal> {
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) {
getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); GET_BBC().PUT_INIT(BassBoneStoreKey.ID_TONE, idTone);
getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); GET_BBC().PUT_INIT(BassBoneStoreKey.ID_LETTER, idLetter);
getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); GET_BBC().PUT_INIT(BassBoneStoreKey.CHINA_KEY, chinaKey);
getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); GET_BBC().PUT_INIT(BassBoneStoreKey.CHINA_VALUE, chinaValue);
getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); GET_BBC().PUT_INIT(BassBoneStoreKey.ALT_1_VALUE, alt1Value);
getBBC().putInit(BassBoneStoreKey.ALT_2_VALUE, alt2Value); GET_BBC().PUT_INIT(BassBoneStoreKey.ALT_2_VALUE, alt2Value);
getBBC().putInit(BassBoneStoreKey.ALT_3_VALUE, alt3Value); GET_BBC().PUT_INIT(BassBoneStoreKey.ALT_3_VALUE, alt3Value);
getBBC().putInit(BassBoneStoreKey.ALT_4_VALUE, alt4Value); GET_BBC().PUT_INIT(BassBoneStoreKey.ALT_4_VALUE, alt4Value);
getBBC().getMapObject(BassBoneStoreKey.MAP_TONE); GET_BBC().GET_MAP_OBJ(BassBoneStoreKey.MAP_TONE);
getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA); GET_BBC().GET_MAP_OBJ(BassBoneStoreKey.MAP_CHINA);
} }
@Override @Override
public BassBoneCoffin getBBC() { public BassBoneCoffin GET_BBC() {
return bbc; return bbc;
} }
} }

View file

@ -32,17 +32,17 @@ public enum T11PartUndecimal implements BassBoneAlt1<T11PartUndecimal> {
private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); private final BassBoneCoffin bbc = BassBoneCoffin.newInstance();
private T11PartUndecimal(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) { private T11PartUndecimal(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) {
getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); GET_BBC().PUT_INIT(BassBoneStoreKey.ID_TONE, idTone);
getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); GET_BBC().PUT_INIT(BassBoneStoreKey.ID_LETTER, idLetter);
getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); GET_BBC().PUT_INIT(BassBoneStoreKey.CHINA_KEY, chinaKey);
getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); GET_BBC().PUT_INIT(BassBoneStoreKey.CHINA_VALUE, chinaValue);
getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); GET_BBC().PUT_INIT(BassBoneStoreKey.ALT_1_VALUE, alt1Value);
getBBC().getMapObject(BassBoneStoreKey.MAP_TONE); GET_BBC().GET_MAP_OBJ(BassBoneStoreKey.MAP_TONE);
getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA); GET_BBC().GET_MAP_OBJ(BassBoneStoreKey.MAP_CHINA);
} }
@Override @Override
public BassBoneCoffin getBBC() { public BassBoneCoffin GET_BBC() {
return bbc; return bbc;
} }
} }

View file

@ -33,17 +33,17 @@ public enum T12PartUncial implements BassBoneAlt1<T12PartUncial> {
private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); private final BassBoneCoffin bbc = BassBoneCoffin.newInstance();
private T12PartUncial(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) { private T12PartUncial(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) {
getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); GET_BBC().PUT_INIT(BassBoneStoreKey.ID_TONE, idTone);
getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); GET_BBC().PUT_INIT(BassBoneStoreKey.ID_LETTER, idLetter);
getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); GET_BBC().PUT_INIT(BassBoneStoreKey.CHINA_KEY, chinaKey);
getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); GET_BBC().PUT_INIT(BassBoneStoreKey.CHINA_VALUE, chinaValue);
getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); GET_BBC().PUT_INIT(BassBoneStoreKey.ALT_1_VALUE, alt1Value);
getBBC().getMapObject(BassBoneStoreKey.MAP_TONE); GET_BBC().GET_MAP_OBJ(BassBoneStoreKey.MAP_TONE);
getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA); GET_BBC().GET_MAP_OBJ(BassBoneStoreKey.MAP_CHINA);
} }
@Override @Override
public BassBoneCoffin getBBC() { public BassBoneCoffin GET_BBC() {
return bbc; return bbc;
} }
} }

View file

@ -37,17 +37,17 @@ public enum T16PartHex implements BassBoneAlt1<T16PartHex> {
private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); private final BassBoneCoffin bbc = BassBoneCoffin.newInstance();
private T16PartHex(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) { private T16PartHex(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) {
getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); GET_BBC().PUT_INIT(BassBoneStoreKey.ID_TONE, idTone);
getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); GET_BBC().PUT_INIT(BassBoneStoreKey.ID_LETTER, idLetter);
getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); GET_BBC().PUT_INIT(BassBoneStoreKey.CHINA_KEY, chinaKey);
getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); GET_BBC().PUT_INIT(BassBoneStoreKey.CHINA_VALUE, chinaValue);
getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); GET_BBC().PUT_INIT(BassBoneStoreKey.ALT_1_VALUE, alt1Value);
getBBC().getMapObject(BassBoneStoreKey.MAP_TONE); GET_BBC().GET_MAP_OBJ(BassBoneStoreKey.MAP_TONE);
getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA); GET_BBC().GET_MAP_OBJ(BassBoneStoreKey.MAP_CHINA);
} }
@Override @Override
public BassBoneCoffin getBBC() { public BassBoneCoffin GET_BBC() {
return bbc; return bbc;
} }

View file

@ -53,19 +53,19 @@ public enum T20PartScore implements BassBoneAlt3<T20PartScore> {
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) {
getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); GET_BBC().PUT_INIT(BassBoneStoreKey.ID_TONE, idTone);
getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); GET_BBC().PUT_INIT(BassBoneStoreKey.ID_LETTER, idLetter);
getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); GET_BBC().PUT_INIT(BassBoneStoreKey.CHINA_KEY, chinaKey);
getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); GET_BBC().PUT_INIT(BassBoneStoreKey.CHINA_VALUE, chinaValue);
getBBC().putInit(BassBoneStoreKey.ALT_1_VALUE, alt1Value); GET_BBC().PUT_INIT(BassBoneStoreKey.ALT_1_VALUE, alt1Value);
getBBC().putInit(BassBoneStoreKey.ALT_2_VALUE, alt2Value); GET_BBC().PUT_INIT(BassBoneStoreKey.ALT_2_VALUE, alt2Value);
getBBC().putInit(BassBoneStoreKey.ALT_3_VALUE, alt3Value); GET_BBC().PUT_INIT(BassBoneStoreKey.ALT_3_VALUE, alt3Value);
getBBC().getMapObject(BassBoneStoreKey.MAP_TONE); GET_BBC().GET_MAP_OBJ(BassBoneStoreKey.MAP_TONE);
getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA); GET_BBC().GET_MAP_OBJ(BassBoneStoreKey.MAP_CHINA);
} }
@Override @Override
public BassBoneCoffin getBBC() { public BassBoneCoffin GET_BBC() {
return bbc; return bbc;
} }

View file

@ -82,16 +82,16 @@ public enum T60Sexagesimal implements BassBone<T60Sexagesimal> {
private final BassBoneCoffin bbc = BassBoneCoffin.newInstance(); private final BassBoneCoffin bbc = BassBoneCoffin.newInstance();
private T60Sexagesimal(String idTone, String idLetter, String chinaKey, String chinaValue) { private T60Sexagesimal(String idTone, String idLetter, String chinaKey, String chinaValue) {
getBBC().putInit(BassBoneStoreKey.ID_TONE, idTone); GET_BBC().PUT_INIT(BassBoneStoreKey.ID_TONE, idTone);
getBBC().putInit(BassBoneStoreKey.ID_LETTER, idLetter); GET_BBC().PUT_INIT(BassBoneStoreKey.ID_LETTER, idLetter);
getBBC().putInit(BassBoneStoreKey.CHINA_KEY, chinaKey); GET_BBC().PUT_INIT(BassBoneStoreKey.CHINA_KEY, chinaKey);
getBBC().putInit(BassBoneStoreKey.CHINA_VALUE, chinaValue); GET_BBC().PUT_INIT(BassBoneStoreKey.CHINA_VALUE, chinaValue);
getBBC().getMapObject(BassBoneStoreKey.MAP_TONE); GET_BBC().GET_MAP_OBJ(BassBoneStoreKey.MAP_TONE);
getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA); GET_BBC().GET_MAP_OBJ(BassBoneStoreKey.MAP_CHINA);
} }
@Override @Override
public BassBoneCoffin getBBC() { public BassBoneCoffin GET_BBC() {
return bbc; return bbc;
} }
} }

View file

@ -8,31 +8,31 @@ import java.util.stream.Collectors;
* *
* @author willemtsade ©Δ 仙上主天 * @author willemtsade ©Δ 仙上主天
*/ */
public interface BassBone<T extends BassBone<T>> extends BassBoneEnum<T>, BassBoneStore { public interface BassBone<T extends BassBone<T>> extends BassBoneEnumSet<T>, BassBoneStore {
default String staticBoneNaam() { default String staticBoneNaam() {
return getClass().getAnnotation(BassBoneName.class).value(); return getClass().getAnnotation(BassBoneName.class).value();
} }
default String getIdentifierTone() { default String getIdentifierTone() {
return getBBC().getString(BassBoneStoreKey.ID_TONE); return GET_BBC().GET_STR(BassBoneStoreKey.ID_TONE);
} }
default String getIdentifierLetter() { default String getIdentifierLetter() {
return getBBC().getString(BassBoneStoreKey.ID_LETTER); return GET_BBC().GET_STR(BassBoneStoreKey.ID_LETTER);
} }
default String getChinaKey() { default String getChinaKey() {
return getBBC().getString(BassBoneStoreKey.CHINA_KEY); return GET_BBC().GET_STR(BassBoneStoreKey.CHINA_KEY);
} }
default String getChinaValue() { default String getChinaValue() {
return getBBC().getString(BassBoneStoreKey.CHINA_VALUE); return GET_BBC().GET_STR(BassBoneStoreKey.CHINA_VALUE);
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
default T staticValueOfTone(String identifierTone) { default T staticValueOfTone(String identifierTone) {
Map<String,Object> mapTone = getBBC().getMapObject(BassBoneStoreKey.MAP_TONE); Map<String,Object> mapTone = GET_BBC().GET_MAP_OBJ(BassBoneStoreKey.MAP_TONE);
if (mapTone.isEmpty()) { if (mapTone.isEmpty()) {
mapTone.putAll(staticInstancesStream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v))); mapTone.putAll(staticInstancesStream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v)));
} }
@ -41,7 +41,7 @@ public interface BassBone<T extends BassBone<T>> extends BassBoneEnum<T>, BassBo
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
default T staticValueOfChina(String chinaKey) { default T staticValueOfChina(String chinaKey) {
Map<String,Object> mapChina = getBBC().getMapObject(BassBoneStoreKey.MAP_CHINA); Map<String,Object> mapChina = GET_BBC().GET_MAP_OBJ(BassBoneStoreKey.MAP_CHINA);
if (mapChina.isEmpty()) { if (mapChina.isEmpty()) {
mapChina.putAll(staticInstancesStream().collect(Collectors.toMap(v -> v.getChinaKey(), v -> v))); mapChina.putAll(staticInstancesStream().collect(Collectors.toMap(v -> v.getChinaKey(), v -> v)));
} }

View file

@ -8,7 +8,7 @@ package love.distributedrebirth.numberxd.base2t.bone;
public interface BassBoneAlt1<T extends BassBone<T>> extends BassBone<T> { public interface BassBoneAlt1<T extends BassBone<T>> extends BassBone<T> {
default String getAlt1Value() { default String getAlt1Value() {
return getBBC().getString(BassBoneStoreKey.ALT_1_VALUE); return GET_BBC().GET_STR(BassBoneStoreKey.ALT_1_VALUE);
} }
default String staticAlt1Name() { default String staticAlt1Name() {

View file

@ -8,7 +8,7 @@ package love.distributedrebirth.numberxd.base2t.bone;
public interface BassBoneAlt2<T extends BassBone<T>> extends BassBoneAlt1<T> { public interface BassBoneAlt2<T extends BassBone<T>> extends BassBoneAlt1<T> {
default String getAlt2Value() { default String getAlt2Value() {
return getBBC().getString(BassBoneStoreKey.ALT_2_VALUE); return GET_BBC().GET_STR(BassBoneStoreKey.ALT_2_VALUE);
} }
default String staticAlt2Name() { default String staticAlt2Name() {

View file

@ -8,7 +8,7 @@ package love.distributedrebirth.numberxd.base2t.bone;
public interface BassBoneAlt3<T extends BassBone<T>> extends BassBoneAlt2<T> { public interface BassBoneAlt3<T extends BassBone<T>> extends BassBoneAlt2<T> {
default String getAlt3Value() { default String getAlt3Value() {
return getBBC().getString(BassBoneStoreKey.ALT_3_VALUE); return GET_BBC().GET_STR(BassBoneStoreKey.ALT_3_VALUE);
} }
default String staticAlt3Name() { default String staticAlt3Name() {

View file

@ -8,7 +8,7 @@ package love.distributedrebirth.numberxd.base2t.bone;
public interface BassBoneAlt4<T extends BassBone<T>> extends BassBoneAlt3<T> { public interface BassBoneAlt4<T extends BassBone<T>> extends BassBoneAlt3<T> {
default String getAlt4Value() { default String getAlt4Value() {
return getBBC().getString(BassBoneStoreKey.ALT_4_VALUE); return GET_BBC().GET_STR(BassBoneStoreKey.ALT_4_VALUE);
} }
default String staticAlt4Name() { default String staticAlt4Name() {

View file

@ -5,40 +5,40 @@ import java.util.Map;
public interface BassBoneCoffin { public interface BassBoneCoffin {
Object putInit(BassBoneStoreKey key, Object value); Object PUT_INIT(BassBoneStoreKey key, Object value);
Object get(BassBoneStoreKey key); Object GET(BassBoneStoreKey key);
default String getString(BassBoneStoreKey key) { default String GET_STR(BassBoneStoreKey key) {
return String.class.cast(get(key)); return String.class.cast(GET(key));
} }
default Integer getInteger(BassBoneStoreKey key) { default Integer GET_INT(BassBoneStoreKey key) {
return Integer.class.cast(get(key)); return Integer.class.cast(GET(key));
} }
default Long getLong(BassBoneStoreKey key) { default Long GET_LONG(BassBoneStoreKey key) {
return Long.class.cast(get(key)); return Long.class.cast(GET(key));
} }
default Boolean getBoolean(BassBoneStoreKey key) { default Boolean GET_BOOL(BassBoneStoreKey key) {
return Boolean.class.cast(get(key)); return Boolean.class.cast(GET(key));
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
default Map<String,Object> getMapObject(BassBoneStoreKey key) { default Map<String,Object> GET_MAP_OBJ(BassBoneStoreKey key) {
if (get(key) == null) { if (GET(key) == null) {
putInit(key, new HashMap<>()); PUT_INIT(key, new HashMap<>());
} }
return Map.class.cast(get(key)); return Map.class.cast(GET(key));
} }
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
default Map<String,String> getMapString(BassBoneStoreKey key) { default Map<String,String> GET_MAP_STR(BassBoneStoreKey key) {
if (get(key) == null) { if (GET(key) == null) {
putInit(key, new HashMap<>()); PUT_INIT(key, new HashMap<>());
} }
return Map.class.cast(get(key)); return Map.class.cast(GET(key));
} }
static BassBoneCoffin newInstance() { static BassBoneCoffin newInstance() {
@ -46,12 +46,12 @@ public interface BassBoneCoffin {
final Map<BassBoneStoreKey,Object> initMap = new HashMap<>(); final Map<BassBoneStoreKey,Object> initMap = new HashMap<>();
@Override @Override
public Object get(BassBoneStoreKey key) { public Object GET(BassBoneStoreKey key) {
return initMap.get(key); return initMap.get(key);
} }
@Override @Override
public Object putInit(BassBoneStoreKey key, Object value) { public Object PUT_INIT(BassBoneStoreKey key, Object value) {
return initMap.put(key, value); return initMap.put(key, value);
} }
}; };

View file

@ -1,11 +1,5 @@
package love.distributedrebirth.numberxd.base2t.bone; 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;
/** /**
* *
* *
@ -20,62 +14,4 @@ public interface BassBoneEnum<T> {
default String naam() { default String naam() {
return name(); // Deutsche code 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

@ -0,0 +1,73 @@
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 BassBoneEnumSet<T> extends BassBoneEnum<T> {
@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

@ -8,6 +8,6 @@ package love.distributedrebirth.numberxd.base2t.bone;
public interface BassBoneShiftBits<T extends BassBone<T>> extends BassBone<T> { public interface BassBoneShiftBits<T extends BassBone<T>> extends BassBone<T> {
default Integer getShiftBits() { default Integer getShiftBits() {
return getBBC().getInteger(BassBoneStoreKey.SHIFT_BITS); return GET_BBC().GET_INT(BassBoneStoreKey.SHIFT_BITS);
} }
} }

View file

@ -7,5 +7,5 @@ package love.distributedrebirth.numberxd.base2t.bone;
*/ */
public interface BassBoneStore { public interface BassBoneStore {
BassBoneCoffin getBBC(); BassBoneCoffin GET_BBC();
} }