Toegevoegt klompen en kaas getallen.

This commit is contained in:
Willem Cazander 2022-01-30 19:04:03 +01:00
parent 9e806b7669
commit e3e5c2fb15
6 changed files with 342 additions and 18 deletions

View file

@ -1,5 +1,109 @@
package love.distributedrebirth.demo4d.base2t; package love.distributedrebirth.demo4d.base2t;
public enum T60Sexagesimal { import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.function.Consumer;
import java.util.stream.Collectors;
import love.distributedrebirth.demo4d.base2t.facet.BaseFacet;
import love.distributedrebirth.demo4d.base2t.facet.BaseFacetKey;
public enum T60Sexagesimal implements BaseFacet {
// TODO impl too // TODO impl too
PART_1 ("˧","0","","100"),
PART_2 ("˧","1","","101"), // ?
PART_3 ("˧","2","",""),
PART_4 ("˧","3","",""),
PART_5 ("˧","4","",""),
PART_6 ("˧","5","",""),
PART_7 ("˧","6","",""),
PART_8 ("˧","7","",""),
PART_9 ("˧","8","",""),
PART_10("˧","9","",""),
PART_11("˧","10","",""),
PART_12("˧","11","",""),
PART_13("˧","","",""),
PART_14("˧","","",""),
PART_15("˧","","",""),
PART_16("˧","","",""),
PART_17("˧","","",""),
PART_18("˧","","",""),
PART_19("˧","","",""),
PART_20("˧","","",""),
PART_21("˧","","",""),
PART_22("˧","","",""),
PART_23("˧","","",""),
PART_24("˧","","",""),
PART_25("˧","","",""),
PART_26("˧","","",""),
PART_27("˧","","",""),
PART_28("˧","","",""),
PART_29("˧","","",""),
PART_30("˧","","",""),
PART_31("˧","","",""),
PART_32("˧","","",""),
PART_33("˧","","",""),
PART_34("˧","","",""),
PART_35("˧","","",""),
PART_36("˧","","",""),
PART_37("˧","","",""),
PART_38("˧","","",""),
PART_39("˧","","",""),
PART_40("˧","","",""),
PART_41("˧","","",""),
PART_42("˧","","",""),
PART_43("˧","","",""),
PART_44("˧","","",""),
PART_45("˧","","",""),
PART_46("˧","","",""),
PART_47("˧","","",""),
PART_48("˧","","",""),
PART_49("˧","","",""),
PART_50("˧","","",""),
PART_51("˧","","",""),
PART_52("˧","","",""),
PART_53("˧","","",""),
PART_54("˧","","",""),
PART_55("˧","","",""),
PART_56("˧","","",""),
PART_57("˧","","",""),
PART_58("˧","","",""),
PART_59("˧","","",""),
PART_60("˧","","",""),
;
public static int LENGTH = 60;
private final Map<BaseFacetKey, Object> facetStore = new HashMap<>();
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) {
this.getFacetStore().put(BaseFacetKey.ID_TONE, idTone);
this.getFacetStore().put(BaseFacetKey.ID_LETTER, idLetter);
this.getFacetStore().put(BaseFacetKey.CHINA_KEY, chinaKey);
this.getFacetStore().put(BaseFacetKey.CHINA_VALUE, chinaValue);
}
@Override
public Map<BaseFacetKey, Object> getFacetStore() {
return facetStore;
}
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);
}
} }

View file

@ -1,12 +0,0 @@
package love.distributedrebirth.demo4d.base2t;
/**
* Holds an 1620 bit value.
*
* @author willemtsade ©Δ 仙上主天
*
*/
public class V654Tath {
// TODO: 27(V01BTemvig) * T60Sexagesimal
}

View file

@ -0,0 +1,53 @@
package love.distributedrebirth.demo4d.base2t;
/**
* Holds an 1620 bit value.
*
* @author willemtsade ©Δ 仙上主天
*
*/
public class V654Triz implements BaseNumberTyte<V654Triz> {
public static int BIT_COUNT = V01BTemvig.BIT_COUNT * T60Sexagesimal.LENGTH;
private V01BTemvig[] values = new V01BTemvig[T60Sexagesimal.LENGTH];
public V654Triz() {
for (int i=0;i<T60Sexagesimal.LENGTH;i++) {
this.values[i] = new V01BTemvig();
}
}
public V654Triz(T08PartOctalBaseIterator values) {
for (int i=0;i<T60Sexagesimal.LENGTH;i++) {
this.values[i] = new V01BTemvig(values);
}
}
public V01BTemvig getValue(T60Sexagesimal part) {
return values[part.ordinal()];
}
public void setValue(T60Sexagesimal part, V01BTemvig value) {
values[part.ordinal()] = value;
}
@Override
public int getBitCount() {
return BIT_COUNT;
}
@Override
public V654Triz toClone() {
return new V654Triz(cloneIterator());
}
@Override
public void fillOctalValues(T08PartOctalBaseAppender appender) {
T60Sexagesimal.forEach(v -> getValue(v).fillOctalValues(appender));
}
@Override
public void fillTyteValues(V009TyteBaseAppender appender) {
T60Sexagesimal.forEach(v -> getValue(v).fillTyteValues(appender));
}
}

View file

@ -0,0 +1,54 @@
package love.distributedrebirth.demo4d.base2t;
/**
* Holds an 3240 bit value.
*
* @author willemtsade ©Δ 仙上主天
*
*/
public class VCA8Tath implements BaseNumberTyte<VCA8Tath> {
public static int BIT_COUNT = V654Triz.BIT_COUNT * T02PartBinary.LENGTH;
private V654Triz[] values = new V654Triz[T02PartBinary.LENGTH];
public VCA8Tath() {
this(new V654Triz(), new V654Triz());
}
public VCA8Tath(T08PartOctalBaseIterator values) {
this(new V654Triz(values), new V654Triz(values));
}
private VCA8Tath(V654Triz valueHigh, V654Triz valueLow) {
setValue(T02PartBinary.PART_1, valueHigh);
setValue(T02PartBinary.PART_2, valueLow);
}
public V654Triz getValue(T02PartBinary part) {
return values[part.ordinal()];
}
public void setValue(T02PartBinary part, V654Triz value) {
values[part.ordinal()] = value;
}
@Override
public int getBitCount() {
return BIT_COUNT;
}
@Override
public VCA8Tath toClone() {
return new VCA8Tath(cloneIterator());
}
@Override
public void fillOctalValues(T08PartOctalBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillOctalValues(appender));
}
@Override
public void fillTyteValues(V009TyteBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillTyteValues(appender));
}
}

View file

@ -1,6 +1,74 @@
package love.distributedrebirth.demo4d.fraction4d; package love.distributedrebirth.demo4d.fraction4d;
public class KaassGetậl { import love.distributedrebirth.demo4d.base2t.BaseNumberTyte;
import love.distributedrebirth.demo4d.base2t.T08PartOctalBaseAppender;
import love.distributedrebirth.demo4d.base2t.T08PartOctalBaseIterator;
import love.distributedrebirth.demo4d.base2t.V009TyteBaseAppender;
// array of KlompGetậl sliced as cheese /**
* Array of KlompGetậl sliced as cheese.
*
* @author willemtsade ©Δ 仙上主天
*
*/
public class KaassGetậl implements BaseNumberTyte<KaassGetậl> {
private KlompGetậl[] kaas;
private final int kaasCuts;
public KaassGetậl(int kaasCuts) {
this.kaasCuts = kaasCuts;
this.kaas = new KlompGetậl[kaasCuts];
}
public final int getKaasCuts() {
return kaasCuts;
}
private final int validatePartRequest(int part) {
if (part < 0) {
throw new IllegalArgumentException("Requested part is negative");
}
if (part > kaasCuts) {
throw new IllegalArgumentException("Requested part exceeds kaasCuts storage");
}
return part;
}
public final KlompGetậl getValue(int part) {
return kaas[validatePartRequest(part)];
}
public final void setValue(int part, KlompGetậl value) {
kaas[validatePartRequest(part)] = value;
}
@Override
public final KaassGetậl toClone() {
KaassGetậl result = new KaassGetậl(getKaasCuts());
T08PartOctalBaseIterator clonedOctals = cloneIterator();
for (int i=0;i<getKaasCuts();i++) {
result.setValue(i, new KlompGetậl(clonedOctals));
}
return result;
}
@Override
public final int getBitCount() {
return KlompGetậl.BIT_COUNT * kaasCuts;
}
@Override
public final void fillOctalValues(T08PartOctalBaseAppender appender) {
for (KlompGetậl value:kaas) {
value.fillOctalValues(appender);
}
}
@Override
public void fillTyteValues(V009TyteBaseAppender appender) {
for (KlompGetậl value:kaas) {
value.fillTyteValues(appender);
}
}
} }

View file

@ -1,7 +1,64 @@
package love.distributedrebirth.demo4d.fraction4d; package love.distributedrebirth.demo4d.fraction4d;
public class KlompGetậl { import love.distributedrebirth.demo4d.base2t.BaseNumberTyte;
import love.distributedrebirth.demo4d.base2t.T08PartOctal;
import love.distributedrebirth.demo4d.base2t.T08PartOctalBaseAppender;
import love.distributedrebirth.demo4d.base2t.T08PartOctalBaseIterator;
import love.distributedrebirth.demo4d.base2t.V009TyteBaseAppender;
import love.distributedrebirth.demo4d.base2t.V654Triz;
import love.distributedrebirth.demo4d.base2t.VCA8Tath;
// 4 * V654Tath red /**
// 4 * V654Tath blue * Holds an 25920 bit value. (3240 bytes)
*
* 4 * VCA8Tath red
* 4 * VCA8Tath blue
*
* @author willemtsade ©Δ 仙上主天
*
*/
public class KlompGetậl implements BaseNumberTyte<KlompGetậl> {
public static int BIT_COUNT = V654Triz.BIT_COUNT * T08PartOctal.LENGTH;
private final VCA8Tath[] values = new VCA8Tath[T08PartOctal.LENGTH];
public KlompGetậl() {
for (int i=0;i<T08PartOctal.LENGTH;i++) {
this.values[i] = new VCA8Tath();
}
}
public KlompGetậl(T08PartOctalBaseIterator values) {
for (int i=0;i<T08PartOctal.LENGTH;i++) {
this.values[i] = new VCA8Tath(values);
}
}
public VCA8Tath getValue(T08PartOctal part) {
return values[part.ordinal()];
}
public void setValue(T08PartOctal part, VCA8Tath value) {
values[part.ordinal()] = value;
}
@Override
public int getBitCount() {
return BIT_COUNT;
}
@Override
public KlompGetậl toClone() {
return new KlompGetậl(cloneIterator());
}
@Override
public void fillOctalValues(T08PartOctalBaseAppender appender) {
T08PartOctal.forEach(v -> getValue(v).fillOctalValues(appender));
}
@Override
public void fillTyteValues(V009TyteBaseAppender appender) {
T08PartOctal.forEach(v -> getValue(v).fillTyteValues(appender));
}
} }