Moved numberxd to libary and added some unit tests.

This commit is contained in:
Willem Cazander 2022-01-31 15:03:30 +01:00
parent af627bbd06
commit 444ced9ee2
70 changed files with 427 additions and 6 deletions

6
numberxd/build.gradle Normal file
View file

@ -0,0 +1,6 @@
sourceCompatibility = appJvmCode
[compileJava, compileTestJava]*.options*.encoding = appEncoding
sourceSets.main.java.srcDirs = [ "src/main/", "src/resources/" ]
eclipse.project.name = appName + "-numberxd"

View file

@ -0,0 +1,102 @@
package love.distributedrebirth.numberxd;
import java.util.ArrayList;
import java.util.List;
import love.distributedrebirth.numberxd.base2t.BaseNumberTyte;
import love.distributedrebirth.numberxd.base2t.T08PartOctalBaseAppender;
import love.distributedrebirth.numberxd.base2t.T08PartOctalBaseIterator;
import love.distributedrebirth.numberxd.base2t.V009Tyte;
import love.distributedrebirth.numberxd.base2t.V009TyteBaseAppender;
import love.distributedrebirth.numberxd.base2t.V009TyteBaseIterator;
import love.distributedrebirth.numberxd.base2t.V090Tocta;
/**
* Holds an 144 bit fraction.
*
* @author willemtsade ©Δ 仙上主天
*/
public class GroßGetậl1ⁿᴰ implements BaseNumberTyte<GroßGetậl1ⁿᴰ> {
public static int NUMERATOR_SIZE = 7;
public static int DENOMINATOR_SIZE = 9;
public static int BIT_COUNT = V090Tocta.BIT_COUNT;
private final V009Tyte[] numerator = new V009Tyte[NUMERATOR_SIZE];
private final V009Tyte[] denominator = new V009Tyte[DENOMINATOR_SIZE];
public GroßGetậl1ⁿᴰ() {
for (int i=0;i<NUMERATOR_SIZE;i++) {
numerator[i] = new V009Tyte();
}
for (int i=0;i<DENOMINATOR_SIZE;i++) {
denominator[i] = new V009Tyte();
}
}
public GroßGetậl1ⁿᴰ(T08PartOctalBaseIterator values) {
for (int i=0;i<NUMERATOR_SIZE;i++) {
numerator[i] = new V009Tyte(values);
}
for (int i=0;i<DENOMINATOR_SIZE;i++) {
denominator[i] = new V009Tyte(values);
}
}
public GroßGetậl1ⁿᴰ(V009TyteBaseIterator values) {
for (int i=0;i<NUMERATOR_SIZE;i++) {
numerator[i] = values.next();
}
for (int i=0;i<DENOMINATOR_SIZE;i++) {
denominator[i] = values.next();
}
}
public GroßGetậl1ⁿᴰ(V090Tocta tocta) {
List<V009Tyte> tytes = new ArrayList<>();
tocta.fillTytesByReference(new V009TyteBaseAppender(tytes));
for (int i=0;i<NUMERATOR_SIZE;i++) {
numerator[i] = tytes.get(i);
}
for (int i=0;i<DENOMINATOR_SIZE;i++) {
denominator[i] = tytes.get(i+NUMERATOR_SIZE);
}
}
public V090Tocta toToctaByReference() {
return new V090Tocta(iteratorTytesByReference());
}
public V090Tocta toToctaByClone() {
return new V090Tocta(iteratorOctalsByClone());
}
@Override
public int getBitCount() {
return V090Tocta.BIT_COUNT;
}
@Override
public GroßGetậl1ⁿᴰ toClone() {
return new GroßGetậl1ⁿᴰ(iteratorOctalsByClone());
}
@Override
public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
for (int i=0;i<NUMERATOR_SIZE;i++) {
numerator[i].fillOctalsByClone(appender);
}
for (int i=0;i<DENOMINATOR_SIZE;i++) {
denominator[i].fillOctalsByClone(appender);
}
}
@Override
public void fillTytesByReference(V009TyteBaseAppender appender) {
for (int i=0;i<NUMERATOR_SIZE;i++) {
appender.add(numerator[i]);
}
for (int i=0;i<DENOMINATOR_SIZE;i++) {
appender.add(denominator[i]);
}
}
}

View file

@ -0,0 +1,65 @@
package love.distributedrebirth.numberxd;
import love.distributedrebirth.numberxd.base2t.BaseNumberTyte;
import love.distributedrebirth.numberxd.base2t.T08PartOctalBaseAppender;
import love.distributedrebirth.numberxd.base2t.T08PartOctalBaseIterator;
import love.distributedrebirth.numberxd.base2t.T12PartUncial;
import love.distributedrebirth.numberxd.base2t.V009TyteBaseAppender;
import love.distributedrebirth.numberxd.base2t.V009TyteBaseIterator;
/**
* Holds an 864 bit fraction.
*
* @author willemtsade ©Δ 仙上主天
*/
public class GroßGetậl6ˢᴰ implements BaseNumberTyte<GroßGetậl6ˢᴰ> {
public static int BIT_COUNT = GroßGetậl1ⁿᴰ.BIT_COUNT * T12PartUncial.LENGTH;
private GroßGetậl1ⁿᴰ[] values = new GroßGetậl1ⁿᴰ[T12PartUncial.LENGTH];
public GroßGetậl6ˢᴰ() {
for (int i=0;i<T12PartUncial.LENGTH;i++) {
this.values[i] = new GroßGetậl1ⁿᴰ();
}
}
public GroßGetậl6ˢᴰ(T08PartOctalBaseIterator values) {
for (int i=0;i<T12PartUncial.LENGTH;i++) {
this.values[i] = new GroßGetậl1ⁿᴰ(values);
}
}
public GroßGetậl6ˢᴰ(V009TyteBaseIterator values) {
for (int i=0;i<T12PartUncial.LENGTH;i++) {
this.values[i] = new GroßGetậl1ⁿᴰ(values);
}
}
public GroßGetậl1ⁿᴰ getValue(T12PartUncial part) {
return values[part.ordinal()];
}
public void setValue(T12PartUncial part, GroßGetậl1ⁿᴰ value) {
values[part.ordinal()] = value;
}
@Override
public int getBitCount() {
return BIT_COUNT;
}
@Override
public GroßGetậl6ˢᴰ toClone() {
return new GroßGetậl6ˢᴰ(iteratorOctalsByClone());
}
@Override
public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T12PartUncial.forEach(v -> getValue(v).fillOctalsByClone(appender));
}
@Override
public void fillTytesByReference(V009TyteBaseAppender appender) {
T12PartUncial.forEach(v -> getValue(v).fillTytesByReference(appender));
}
}

View file

@ -0,0 +1,75 @@
package love.distributedrebirth.numberxd;
import love.distributedrebirth.numberxd.base2t.BaseNumber;
import love.distributedrebirth.numberxd.base2t.T08PartOctalBaseAppender;
import love.distributedrebirth.numberxd.base2t.T08PartOctalBaseIterator;
/**
* Divide GroßGetậl1ⁿᴰ into resolved fractal slices.
*
* @author willemtsade ©Δ 仙上主天
*/
abstract public class GroßGetậlŌṁ1ⁿᴰ<V extends GroßGetậlŌṁ1ⁿᴰ<V> & BaseNumber<V>> implements BaseNumber<V> {
private GroßGetậl1ⁿᴰ[] values;
private int valuesLength;
private byte fractalLevel;
public GroßGetậlŌṁ1ⁿᴰ(byte fractalLevel) {
this.fractalLevel = fractalLevel;
this.valuesLength = resolveFractalLevel(fractalLevel);
this.values = new GroßGetậl1ⁿᴰ[valuesLength];
}
abstract protected int resolveFractalLevel(byte level);
public final byte getFractalLevel() {
return fractalLevel;
}
public final int getValuesLength() {
return valuesLength;
}
private final int validatePartRequest(int part) {
if (part < 0) {
throw new IllegalArgumentException("Requested part is negative");
}
if (part > valuesLength) {
throw new IllegalArgumentException("Requested part exceeds fractal storage");
}
return part;
}
public final GroßGetậl1ⁿᴰ getValue(int part) {
return values[validatePartRequest(part)];
}
public final void setValue(int part, GroßGetậl1ⁿᴰ value) {
values[validatePartRequest(part)] = value;
}
abstract protected V toCloneFractal(byte level);
@Override
public final V toClone() {
V result = toCloneFractal(getFractalLevel());
T08PartOctalBaseIterator clonedOctals = iteratorOctalsByClone();
for (int i=0;i<getValuesLength();i++) {
result.setValue(i, new GroßGetậl1ⁿᴰ(clonedOctals));
}
return result;
}
@Override
public final int getBitCount() {
return GroßGetậl1ⁿᴰ.BIT_COUNT * valuesLength;
}
@Override
public final void fillOctalsByClone(T08PartOctalBaseAppender appender) {
for (GroßGetậl1ⁿᴰ value:values) {
value.fillOctalsByClone(appender);
}
}
}

View file

@ -0,0 +1,75 @@
package love.distributedrebirth.numberxd;
import love.distributedrebirth.numberxd.base2t.BaseNumber;
import love.distributedrebirth.numberxd.base2t.T08PartOctalBaseAppender;
import love.distributedrebirth.numberxd.base2t.T08PartOctalBaseIterator;
/**
* Divide GroßGetậl6ˢᴰ into resolved fractal slices.
*
* @author willemtsade ©Δ 仙上主天
*/
abstract public class GroßGetậlŌṁ6ˢᴰ<V extends GroßGetậlŌṁ6ˢᴰ<V> & BaseNumber<V>> implements BaseNumber<V> {
private GroßGetậl6ˢᴰ[] values;
private int valuesLength;
private byte fractalLevel;
public GroßGetậlŌṁ6ˢᴰ(byte fractalLevel) {
this.fractalLevel = fractalLevel;
this.valuesLength = resolveFractalLevel(fractalLevel);
this.values = new GroßGetậl6ˢᴰ[valuesLength];
}
abstract protected int resolveFractalLevel(byte level);
public final byte getFractalLevel() {
return fractalLevel;
}
public final int getValuesLength() {
return valuesLength;
}
private final int validatePartRequest(int part) {
if (part < 0) {
throw new IllegalArgumentException("Requested part is negative");
}
if (part > valuesLength) {
throw new IllegalArgumentException("Requested part exceeds fractal storage");
}
return part;
}
public final GroßGetậl6ˢᴰ getValue(int part) {
return values[validatePartRequest(part)];
}
public final void setValue(int part, GroßGetậl6ˢᴰ value) {
values[validatePartRequest(part)] = value;
}
abstract protected V toCloneFractal(byte level);
@Override
public final V toClone() {
V result = toCloneFractal(getFractalLevel());
T08PartOctalBaseIterator clonedOctals = iteratorOctalsByClone();
for (int i=0;i<getValuesLength();i++) {
result.setValue(i, new GroßGetậl6ˢᴰ(clonedOctals));
}
return result;
}
@Override
public final int getBitCount() {
return GroßGetậl6ˢᴰ.BIT_COUNT * valuesLength;
}
@Override
public final void fillOctalsByClone(T08PartOctalBaseAppender appender) {
for (GroßGetậl6ˢᴰ value:values) {
value.fillOctalsByClone(appender);
}
}
}

View file

@ -0,0 +1,28 @@
package love.distributedrebirth.numberxd;
/**
*
* @author willemtsade ©Δ 仙上主天
*/
public class GroßGetậlŌṁDiamond1ⁿᴰ extends GroßGetậlŌṁ1ⁿᴰ<GroßGetậlŌṁDiamond1ⁿᴰ> {
// 0th = 1 * V144Tocta (1)
// 1th = 1+3 * V144Tocta (4)
// 2th = 1+3+6 * V144Tocta (10)
// 3th = 1+3+6+14 * V144Tocta (24)
// etc
public GroßGetậlŌṁDiamond1ⁿᴰ(byte level) {
super(level);
}
protected int resolveFractalLevel(byte level) {
// TODO
return level;
}
@Override
protected GroßGetậlŌṁDiamond1ⁿᴰ toCloneFractal(byte level) {
return new GroßGetậlŌṁDiamond1ⁿᴰ(level);
}
}

View file

@ -0,0 +1,28 @@
package love.distributedrebirth.numberxd;
/**
*
* @author willemtsade ©Δ 仙上主天
*/
public class GroßGetậlŌṁDiamond6ˢᴰ extends GroßGetậlŌṁ6ˢᴰ<GroßGetậlŌṁDiamond6ˢᴰ> {
// 0th = 1 * V144Tocta (1)
// 1th = 1+3 * V144Tocta (4)
// 2th = 1+3+6 * V144Tocta (10)
// 3th = 1+3+6+14 * V144Tocta (24)
// etc
public GroßGetậlŌṁDiamond6ˢᴰ(byte level) {
super(level);
}
protected int resolveFractalLevel(byte level) {
// TODO
return level;
}
@Override
protected GroßGetậlŌṁDiamond6ˢᴰ toCloneFractal(byte level) {
return new GroßGetậlŌṁDiamond6ˢᴰ(level);
}
}

View file

@ -0,0 +1,27 @@
package love.distributedrebirth.numberxd;
/**
*
* @author willemtsade ©Δ 仙上主天
*/
public class GroßGetậlŌṁHyperStar1ⁿᴰ extends GroßGetậlŌṁ1ⁿᴰ<GroßGetậlŌṁHyperStar1ⁿᴰ> {
// 0th = V144Tocta
// 1th = 5 * V144Tocta
// 2th = 5 * 12 * V144Tocta
// etc
public GroßGetậlŌṁHyperStar1ⁿᴰ(byte level) {
super(level);
}
protected int resolveFractalLevel(byte level) {
// TODO
return level;
}
@Override
protected GroßGetậlŌṁHyperStar1ⁿᴰ toCloneFractal(byte level) {
return new GroßGetậlŌṁHyperStar1ⁿᴰ(level);
}
}

View file

@ -0,0 +1,27 @@
package love.distributedrebirth.numberxd;
/**
*
* @author willemtsade ©Δ 仙上主天
*/
public class GroßGetậlŌṁHyperStar6ˢᴰ extends GroßGetậlŌṁ6ˢᴰ<GroßGetậlŌṁHyperStar6ˢᴰ> {
// 0th = V144Tocta
// 1th = 5 * V144Tocta
// 2th = 5 * 12 * V144Tocta
// etc
public GroßGetậlŌṁHyperStar6ˢᴰ(byte level) {
super(level);
}
protected int resolveFractalLevel(byte level) {
// TODO
return level;
}
@Override
protected GroßGetậlŌṁHyperStar6ˢᴰ toCloneFractal(byte level) {
return new GroßGetậlŌṁHyperStar6ˢᴰ(level);
}
}

View file

@ -0,0 +1,192 @@
package love.distributedrebirth.numberxd;
import java.util.ArrayList;
import java.util.List;
import love.distributedrebirth.numberxd.base2t.T04PartQuad;
import love.distributedrebirth.numberxd.base2t.V024Teger;
/**
*
* @author willemtsade ©Δ 仙上主天
*/
public class Gê̄ldGetậl {
private final Gê̄ldGetậlAtHebrew nummerAlphabet;
private final Gê̄ldGetậlAtHebrew nummerDeelA;
private final Gê̄ldGetậlAtHebrew nummerDeelB;
private final Gê̄ldGetậlAtHebrew nummerDeelC;
private final double totalDecimalValue;
private static final Character LEFT_TO_RIGHT_MARK = 0x200E;
private static final Character RIGHT_TO_LEFT_MARK = 0x200F;
public Gê̄ldGetậl(V024Teger teger) {
this(
new Gê̄ldGetậlAtHebrew(teger.getTytePart(T04PartQuad.PART_1)),
new Gê̄ldGetậlAtHebrew(teger.getTytePart(T04PartQuad.PART_2)),
new Gê̄ldGetậlAtHebrew(teger.getTytePart(T04PartQuad.PART_3)),
new Gê̄ldGetậlAtHebrew(teger.getTytePart(T04PartQuad.PART_4))
);
}
public Gê̄ldGetậl(Gê̄ldGetậlAtHebrew nummerAlphabet, Gê̄ldGetậlAtHebrew nummerDeelA, Gê̄ldGetậlAtHebrew nummerDeelB, Gê̄ldGetậlAtHebrew nummerDeelC) {
this.nummerAlphabet = nummerAlphabet;
this.nummerDeelA = nummerDeelA;
this.nummerDeelB = nummerDeelB;
this.nummerDeelC = nummerDeelC;
this.totalDecimalValue = calculateDecimalValue();
}
public Gê̄ldGetậl(String money) {
if (money == null) {
throw new NullPointerException("Can't parse null money");
}
if (money.isEmpty()) {
throw new IllegalArgumentException("Can't parse zero money length");
}
if (money.length() > 8) { // RL + 4 chars + 3 vowels
throw new IllegalArgumentException("Money length should not exceed 8 codepoints");
}
List<Gê̄ldGetậlAtHebrew> result = new ArrayList<>();
Gê̄ldGetậlAtHebrew geldDigit = null;
for (int i=0;i<money.length();i++) {
char codePoint = (char) money.codePointAt(i);
if (LEFT_TO_RIGHT_MARK.equals(codePoint)) {
continue;
}
if (RIGHT_TO_LEFT_MARK.equals(codePoint)) {
continue;
}
if (geldDigit != null) {
Gê̄ldGetậlAtHebrewVowel vowel = Gê̄ldGetậlAtHebrewVowel.valueOfCharacter(codePoint);
if (!Gê̄ldGetậlAtHebrewVowel.NONE.equals(vowel)) {
geldDigit.setVowel(vowel);
result.add(geldDigit);
geldDigit = null;
continue;
} else {
result.add(geldDigit);
}
}
Gê̄ldGetậlAtHebrewLetter letter = Gê̄ldGetậlAtHebrewLetter.valueOfCharacter(codePoint);
if (Gê̄ldGetậlAtHebrewLetter.NONE.equals(letter)) {
throw new IllegalArgumentException("Unknown fraction codepoint: 0x"+Integer.toHexString(codePoint));
}
geldDigit = new Gê̄ldGetậlAtHebrew(letter);
}
if (geldDigit != null) {
result.add(geldDigit);
}
if (result.isEmpty()) {
throw new IllegalArgumentException("No hebrew money found");
}
Gê̄ldGetậlAtHebrew full = result.get(0);
Gê̄ldGetậlAtHebrew deelA = null;
Gê̄ldGetậlAtHebrew deelB = null;
Gê̄ldGetậlAtHebrew deelC = null;
if (result.size() > 1) {
deelA = result.get(1);
} else {
deelA = new Gê̄ldGetậlAtHebrew();
}
if (result.size() > 2) {
deelB = result.get(2);
} else {
deelB = new Gê̄ldGetậlAtHebrew();
}
if (result.size() > 3) {
deelC = result.get(3);
} else {
deelC = new Gê̄ldGetậlAtHebrew();
}
this.nummerAlphabet = full;
this.nummerDeelA = deelA;
this.nummerDeelB = deelB;
this.nummerDeelC = deelC;
this.totalDecimalValue = calculateDecimalValue();
}
private double calculateDecimalValue() {
boolean hasFourDigits =
!Gê̄ldGetậlAtHebrewLetter.NONE.equals(nummerDeelA.getLetter()) &&
!Gê̄ldGetậlAtHebrewLetter.NONE.equals(nummerDeelB.getLetter()) &&
!Gê̄ldGetậlAtHebrewLetter.NONE.equals(nummerDeelC.getLetter());
double totalDecimalValue = nummerAlphabet.toDecimalValue(hasFourDigits);
if (!Gê̄ldGetậlAtHebrewLetter.NONE.equals(nummerDeelA.getLetter())) {
totalDecimalValue += nummerDeelA.toDecimalValue(false);
}
if (!Gê̄ldGetậlAtHebrewLetter.NONE.equals(nummerDeelB.getLetter())) {
totalDecimalValue += nummerDeelB.toDecimalValue(false);
}
if (!Gê̄ldGetậlAtHebrewLetter.NONE.equals(nummerDeelC.getLetter())) {
totalDecimalValue += nummerDeelC.toDecimalValue(false);
}
return totalDecimalValue;
}
public Gê̄ldGetậlAtHebrew getNummerAlphabet() {
return nummerAlphabet;
}
public Gê̄ldGetậlAtHebrew getNummerDeelA() {
return nummerDeelA;
}
public Gê̄ldGetậlAtHebrew getNummerDeelB() {
return nummerDeelB;
}
public Gê̄ldGetậlAtHebrew getNummerDeelC() {
return nummerDeelC;
}
public double getTotalDecimalValue() {
return totalDecimalValue;
}
public V024Teger toTeger() {
V024Teger result = new V024Teger();
result.setTytePart(T04PartQuad.PART_1, nummerAlphabet.toTyte());
result.setTytePart(T04PartQuad.PART_2, nummerDeelA.toTyte());
result.setTytePart(T04PartQuad.PART_3, nummerDeelB.toTyte());
result.setTytePart(T04PartQuad.PART_4, nummerDeelC.toTyte());
return result;
}
public String toHebrewString() {
return toHebrewString(false);
}
public String toHebrewString(boolean reverse) {
StringBuilder buf = new StringBuilder();
buf.append(RIGHT_TO_LEFT_MARK);
buf.append(nummerAlphabet.getLetter().getCharacter());
if (!Gê̄ldGetậlAtHebrewVowel.NONE.equals(nummerAlphabet.getVowel())) {
buf.append(nummerAlphabet.getVowel().getCharacter());
}
if (!Gê̄ldGetậlAtHebrewLetter.NONE.equals(nummerDeelA.getLetter())) {
buf.append(nummerDeelA.getLetter().getCharacter());
if (!Gê̄ldGetậlAtHebrewVowel.NONE.equals(nummerDeelA.getVowel())) {
buf.append(nummerDeelA.getVowel().getCharacter());
}
}
if (!Gê̄ldGetậlAtHebrewLetter.NONE.equals(nummerDeelB.getLetter())) {
buf.append(nummerDeelB.getLetter().getCharacter());
if (!Gê̄ldGetậlAtHebrewVowel.NONE.equals(nummerDeelB.getVowel())) {
buf.append(nummerDeelB.getVowel().getCharacter());
}
}
if (!Gê̄ldGetậlAtHebrewLetter.NONE.equals(nummerDeelC.getLetter())) {
buf.append(nummerDeelC.getLetter().getCharacter());
if (!Gê̄ldGetậlAtHebrewVowel.NONE.equals(nummerDeelC.getVowel())) {
buf.append(nummerDeelC.getVowel().getCharacter());
}
}
if (reverse) {
buf.reverse(); // ImGui skips RL marker so renders wrong....
}
return buf.toString();
}
}

View file

@ -0,0 +1,73 @@
package love.distributedrebirth.numberxd;
import love.distributedrebirth.numberxd.base2t.T03PartTrit;
import love.distributedrebirth.numberxd.base2t.T08PartOctal;
import love.distributedrebirth.numberxd.base2t.V009Tyte;
/**
*
*
* @author willemtsade ©Δ 仙上主天
*/
public class Gê̄ldGetậlAtHebrew {
private static final double NUMERATOR_ONE = 1d;
private static final int FRACTION_POWER = 10;
private Gê̄ldGetậlAtHebrewLetter letter;
private Gê̄ldGetậlAtHebrewVowel vowel;
public Gê̄ldGetậlAtHebrew() {
this.letter = Gê̄ldGetậlAtHebrewLetter.NONE;
this.vowel = Gê̄ldGetậlAtHebrewVowel.NONE;
}
public Gê̄ldGetậlAtHebrew(Gê̄ldGetậlAtHebrewLetter letter) {
this.letter = letter;
this.vowel = Gê̄ldGetậlAtHebrewVowel.NONE;
}
public Gê̄ldGetậlAtHebrew(V009Tyte tyte) {
int value0 = tyte.getValue(T03PartTrit.PART_1).getValue().ordinalOf(T08PartOctal.PART_1);
int value1 = tyte.getValue(T03PartTrit.PART_2).getValue().ordinalOf(T08PartOctal.PART_2);
int value2 = tyte.getValue(T03PartTrit.PART_3).getValue().ordinalOf(T08PartOctal.PART_3);
int combinedValue = value0 + value1 + value2;
letter = Gê̄ldGetậlAtHebrewLetter.indexOf(combinedValue);
vowel = Gê̄ldGetậlAtHebrewVowel.indexOf(combinedValue >> Gê̄ldGetậlAtHebrewLetter.SHIFT_5);
}
public V009Tyte toTyte() {
int combinedValue = letter.ordinal() + (vowel.ordinal() << Gê̄ldGetậlAtHebrewLetter.SHIFT_5);
T08PartOctal value0 = T08PartOctal.indexOf(T08PartOctal.PART_1, combinedValue);
T08PartOctal value1 = T08PartOctal.indexOf(T08PartOctal.PART_2, combinedValue);
T08PartOctal value2 = T08PartOctal.indexOf(T08PartOctal.PART_3, combinedValue);
return new V009Tyte(value0, value1, value2);
}
public double toDecimalValue(boolean firstChar) {
double fraction = letter.getDecimal();
if (firstChar) {
return fraction; // use full value
}
if (!Gê̄ldGetậlAtHebrewVowel.NONE.equals(vowel)) {
fraction = fraction * Math.pow(FRACTION_POWER, vowel.getFractionOffset());
}
double result = NUMERATOR_ONE/fraction;
return result;
}
public Gê̄ldGetậlAtHebrewLetter getLetter() {
return letter;
}
public void setLetter(Gê̄ldGetậlAtHebrewLetter letter) {
this.letter = letter;
}
public Gê̄ldGetậlAtHebrewVowel getVowel() {
return vowel;
}
public void setVowel(Gê̄ldGetậlAtHebrewVowel vowel) {
this.vowel = vowel;
}
}

View file

@ -0,0 +1,106 @@
package love.distributedrebirth.numberxd;
import java.util.Arrays;
import java.util.Collections;
import java.util.Map;
import java.util.stream.Collectors;
/**
*
*
* @author willemtsade ©Δ 仙上主天
*/
public enum Gê̄ldGetậlAtHebrewLetter {
// Unicode is horror in any language else than ascii;
// VS Alphabet order
// VS Unicode order
// VS Gematria order <== leading but with other decimals
NONE (0, (char) 0x05EF),
LETTER_1 (1, (char) 0x05D0),
LETTER_2 (2, (char) 0x05D1),
LETTER_3 (3, (char) 0x05D2),
LETTER_4 (4, (char) 0x05D3),
LETTER_5 (5, (char) 0x05D4),
LETTER_6 (6, (char) 0x05D5),
LETTER_7 (7, (char) 0x05D6),
LETTER_8 (8, (char) 0x05D7),
LETTER_9 (9, (char) 0x05D8),
LETTER_11 (11, (char) 0x05D9),
LETTER_12 (12, (char) 0x05DB),
LETTER_13 (13, (char) 0x05DC),
LETTER_14 (14, (char) 0x05DE),
LETTER_15 (15, (char) 0x05E0),
LETTER_16 (16, (char) 0x05E1),
LETTER_17 (17, (char) 0x05E2),
LETTER_18 (18, (char) 0x05E4),
LETTER_19 (19, (char) 0x05E6),
LETTER_21 (21, (char) 0x05E7),
LETTER_22 (22, (char) 0x05E8),
LETTER_23 (23, (char) 0x05E9),
LETTER_24 (24, (char) 0x05EA),
LETTER_25 (25, (char) 0x05DA),
LETTER_26 (26, (char) 0x05DD),
LETTER_27 (27, (char) 0x05DF),
LETTER_28 (28, (char) 0x05E3),
LETTER_29 (29, (char) 0x05E5),
/* // OLD
LETTER_11 (10, (char) 0x05D9),
LETTER_12 (20, (char) 0x05DB),
LETTER_13 (30, (char) 0x05DC),
LETTER_14 (40, (char) 0x05DE),
LETTER_15 (50, (char) 0x05E0),
LETTER_16 (60, (char) 0x05E1),
LETTER_17 (70, (char) 0x05E2),
LETTER_18 (80, (char) 0x05E4),
LETTER_19 (90, (char) 0x05E6),
LETTER_21 (100, (char) 0x05E7),
LETTER_22 (200, (char) 0x05E8),
LETTER_23 (300, (char) 0x05E9),
LETTER_24 (400, (char) 0x05EA),
LETTER_25 (500, (char) 0x05DA),
LETTER_26 (600, (char) 0x05DD),
LETTER_27 (700, (char) 0x05DF),
LETTER_28 (800, (char) 0x05E3),
LETTER_29 (900, (char) 0x05E5),
*/
LETTER_31 (31, (char) 0x05BE),
LETTER_32 (32, (char) 0x05C0),
LETTER_33 (33, (char) 0x05C3),
LETTER_34 (34, (char) 0x05C6),
;
public static final byte BITMASK = 0b00011111;
public static final byte SHIFT_5 = 5;
private final int decimal;
private final char character;
private static final Map<Character, Gê̄ldGetậlAtHebrewLetter> CHAR_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getCharacter(), v -> v)));
private Gê̄ldGetậlAtHebrewLetter(int decimal, char character) {
this.decimal = decimal;
this.character = character;
}
public int getDecimal() {
return decimal;
}
public char getCharacter() {
return character;
}
public static Gê̄ldGetậlAtHebrewLetter indexOf(int index) {
return values()[index & BITMASK];
}
public static Gê̄ldGetậlAtHebrewLetter valueOfCharacter(char codePoint) {
return CHAR_MAP.getOrDefault(codePoint, Gê̄ldGetậlAtHebrewLetter.NONE);
}
}

View file

@ -0,0 +1,59 @@
package love.distributedrebirth.numberxd;
import java.util.Arrays;
import java.util.Collections;
import java.util.Map;
import java.util.stream.Collectors;
/**
*
*
* @author willemtsade ©Δ 仙上主天
*/
public enum Gê̄ldGetậlAtHebrewVowel {
NONE (0, (char) 0x0000),
VOWEL_1 (1, (char) 0x05B4),
VOWEL_2 (2, (char) 0x05B5),
VOWEL_3 (3, (char) 0x05B6),
VOWEL_4 (4, (char) 0x05B2),
VOWEL_5 (5, (char) 0x05C7),
VOWEL_6 (6, (char) 0x05B7), // 06 = PATAH
VOWEL_7 (7, (char) 0x05A1),
VOWEL_8 (8, (char) 0x05A2),
VOWEL_9 (9, (char) 0x05A3),
VOWEL_10 (10, (char) 0x05B9), // 10 = POINT HOLAM
VOWEL_16 (16, (char) 0x05B8), // 16 = QAMATS
VOWEL_22 (22, (char) 0x0598),
VOWEL_30 (30, (char) 0x05BB), // 30 = QUBUTS
VOWEL_36 (36, (char) 0x05B3), // 36 = HATAF QAMATS
VOWEL_42 (42, (char) 0x05B1), // 50 = HATEF SEGOL
;
public static final byte BITMASK = 0b00001111;
private final int fractionOffset;
private final char character;
private static final Map<Character, Gê̄ldGetậlAtHebrewVowel> CHAR_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getCharacter(), v -> v)));
private Gê̄ldGetậlAtHebrewVowel(int fractionOffset, char character) {
this.fractionOffset = fractionOffset;
this.character = character;
}
public int getFractionOffset() {
return fractionOffset;
}
public char getCharacter() {
return character;
}
public static Gê̄ldGetậlAtHebrewVowel indexOf(int index) {
return values()[index & BITMASK];
}
public static Gê̄ldGetậlAtHebrewVowel valueOfCharacter(char codePoint) {
return CHAR_MAP.getOrDefault(codePoint, Gê̄ldGetậlAtHebrewVowel.NONE);
}
}

View file

@ -0,0 +1,102 @@
package love.distributedrebirth.numberxd.base2t;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* Terminate from and to classical bytes.
*
* @author willemtsade ©Δ 仙上主天
*/
public class Base2Terminator {
private static final int STREAM_EOF = -1;
private static final int BLOCK_TONG_SIZE = 9;
private static final int BLOCK_TOCTA_SIZE = 18;
private static final int SHIFT_8 = 8;
private static final int SHIFT_16 = 16;
public int base2ReadTong(InputStream input, List<V048Tong> output) throws IOException {
int totalBytes = 0;
byte[] data = new byte[BLOCK_TONG_SIZE];
int readDataSize = 0; // per 9 bytes we have 24 octals for one V072Tong number
while ((readDataSize = input.read(data, 0, data.length)) != STREAM_EOF) {
base2ReadCheckSize(readDataSize, BLOCK_TONG_SIZE);
int v0 = data[0] + (data[1] << SHIFT_8) + (data[2] << SHIFT_16);
int v1 = data[3] + (data[4] << SHIFT_8) + (data[5] << SHIFT_16);
int v2 = data[6] + (data[7] << SHIFT_8) + (data[8] << SHIFT_16);
List<T08PartOctal> octals = base2ReadOctals(v0, v1, v2);
output.add(new V048Tong(new T08PartOctalBaseIterator(octals.iterator())));
totalBytes += BLOCK_TONG_SIZE;
}
return totalBytes;
}
public int base2ReadTocta(InputStream input, List<V090Tocta> output) throws IOException {
int totalBytes = 0;
byte[] data = new byte[BLOCK_TOCTA_SIZE];
int readDataSize = 0; // per 18 bytes we have 48 octals for one V144Tocta number
while ((readDataSize = input.read(data, 0, data.length)) != STREAM_EOF) {
base2ReadCheckSize(readDataSize, BLOCK_TOCTA_SIZE);
int v0 = data[0] + (data[1] << SHIFT_8) + (data[2] << SHIFT_16);
int v1 = data[3] + (data[4] << SHIFT_8) + (data[5] << SHIFT_16);
int v2 = data[6] + (data[7] << SHIFT_8) + (data[8] << SHIFT_16);
int v3 = data[9] + (data[10] << SHIFT_8) + (data[11] << SHIFT_16);
int v4 = data[12] + (data[13] << SHIFT_8) + (data[14] << SHIFT_16);
int v5 = data[15] + (data[16] << SHIFT_8) + (data[17] << SHIFT_16);
List<T08PartOctal> octals = base2ReadOctals(v0, v1, v2, v3, v4, v5);
output.add(new V090Tocta(new T08PartOctalBaseIterator(octals.iterator())));
totalBytes += BLOCK_TOCTA_SIZE;
}
return totalBytes;
}
private void base2ReadCheckSize(int readDataSize, int expectedSize) throws IOException {
if (readDataSize < expectedSize) {
throw new IOException("Expected "+expectedSize+" bytes, got: "+readDataSize);
}
}
private List<T08PartOctal> base2ReadOctals(int...values) {
List<T08PartOctal> octals = new ArrayList<>();
for (int value:values) {
T08PartOctal.forEach(v -> octals.add(T08PartOctal.indexOf(v, value)));
}
return octals;
}
public int base2WriteTong(List<V048Tong> data, OutputStream output) throws IOException {
return base2Write(data, output);
}
public int base2WriteTocta(List<V090Tocta> data, OutputStream output) throws IOException {
return base2Write(data, output);
}
private <T extends BaseNumber<T>> int base2Write(List<T> data, OutputStream output) throws IOException {
int totalBytes = 0; // per 8 octa's is 3 bytes
List<T08PartOctal> octals = new ArrayList<>();
T08PartOctalBaseAppender appender = new T08PartOctalBaseAppender(octals);
data.forEach(v -> v.fillOctalsByClone(appender));
Iterator<T08PartOctal> read = octals.iterator();
while (read.hasNext()) {
int byteTriplet = 0;
byteTriplet += read.next().ordinalOf(T08PartOctal.PART_1);
byteTriplet += read.next().ordinalOf(T08PartOctal.PART_2);
byteTriplet += read.next().ordinalOf(T08PartOctal.PART_3);
byteTriplet += read.next().ordinalOf(T08PartOctal.PART_4);
byteTriplet += read.next().ordinalOf(T08PartOctal.PART_5);
byteTriplet += read.next().ordinalOf(T08PartOctal.PART_6);
byteTriplet += read.next().ordinalOf(T08PartOctal.PART_7);
byteTriplet += read.next().ordinalOf(T08PartOctal.PART_8);
output.write(byteTriplet);
output.write(byteTriplet >> SHIFT_8);
output.write(byteTriplet >> SHIFT_16);
totalBytes += 3;
}
return totalBytes;
}
}

View file

@ -0,0 +1,11 @@
package love.distributedrebirth.numberxd.base2t;
/**
* Collection appender interface.
*
* @author willemtsade ©Δ 仙上主天
*/
public interface BaseAppender<T> {
void add(T value);
}

View file

@ -0,0 +1,30 @@
package love.distributedrebirth.numberxd.base2t;
import java.util.ArrayList;
import java.util.List;
/**
* Octal base based number interface.
*
* @author willemtsade ©Δ 仙上主天
*/
public interface BaseNumber<V extends BaseNumber<V>> {
static float CIRCLE_DEGREE = 360f;
int getBitCount();
default float getSliceAngle() {
return CIRCLE_DEGREE/getBitCount();
}
V toClone();
void fillOctalsByClone(T08PartOctalBaseAppender appender);
default T08PartOctalBaseIterator iteratorOctalsByClone() {
List<T08PartOctal> octals = new ArrayList<>();
fillOctalsByClone(new T08PartOctalBaseAppender(octals));
return new T08PartOctalBaseIterator(octals.iterator());
}
}

View file

@ -0,0 +1,20 @@
package love.distributedrebirth.numberxd.base2t;
import java.util.ArrayList;
import java.util.List;
/**
* Adds Tyte fill and reference support.
*
* @author willemtsade ©Δ 仙上主天
*/
public interface BaseNumberTyte<V extends BaseNumber<V>> extends BaseNumber<V> {
void fillTytesByReference(V009TyteBaseAppender appender);
default V009TyteBaseIterator iteratorTytesByReference() {
List<V009Tyte> tytes = new ArrayList<>();
fillTytesByReference(new V009TyteBaseAppender(tytes));
return new V009TyteBaseIterator(tytes.iterator());
}
}

View file

@ -0,0 +1,56 @@
package love.distributedrebirth.numberxd.base2t;
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.numberxd.base2t.facet.BasePart;
import love.distributedrebirth.numberxd.base2t.facet.BaseFacetKey;
/**
* The distribution by 2.
*
* @author willemtsade ©Δ 仙上主天
*/
public enum T02PartBinary implements BasePart {
PART_1("˧","0", "", "low"),
PART_2("","1", "", "high"),
;
public static int LENGTH = 2;
private final Map<BaseFacetKey, Object> facetStore = new HashMap<>();
private static final Map<String, T02PartBinary> TONE_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v)));
private static final Map<String, T02PartBinary> CHINA_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getChinaKey(), v -> v)));
private T02PartBinary(String idTone, String idLetter, String chinaKey, String chinaValue) {
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<T02PartBinary> consumer) {
for (T02PartBinary value:values()) {
consumer.accept(value);
}
}
public static T02PartBinary valueOfTone(String identifierTone) {
return TONE_MAP.get(identifierTone);
}
public static T02PartBinary valueOfChina(String chinaKey) {
return CHINA_MAP.get(chinaKey);
}
}

View file

@ -0,0 +1,57 @@
package love.distributedrebirth.numberxd.base2t;
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.numberxd.base2t.facet.BasePart;
import love.distributedrebirth.numberxd.base2t.facet.BaseFacetKey;
/**
* The distribution by 3.
*
* @author willemtsade ©Δ 仙上主天
*/
public enum T03PartTrit implements BasePart {
PART_1("˦","0","","1"),
PART_2("˧","1","","2"),
PART_3("˨","2","","3"),
;
public static int LENGTH = 3;
private final Map<BaseFacetKey, Object> facetStore = new HashMap<>();
private static final Map<String, T03PartTrit> TONE_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v)));
private static final Map<String, T03PartTrit> CHINA_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getChinaKey(), v -> v)));
private T03PartTrit(String idTone, String idLetter, String chinaKey, String chinaValue) {
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<T03PartTrit> consumer) {
for (T03PartTrit value:values()) {
consumer.accept(value);
}
}
public static T03PartTrit valueOfTone(String identifierTone) {
return TONE_MAP.get(identifierTone);
}
public static T03PartTrit valueOfChina(String chinaKey) {
return CHINA_MAP.get(chinaKey);
}
}

View file

@ -0,0 +1,65 @@
package love.distributedrebirth.numberxd.base2t;
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.numberxd.base2t.facet.BasePart;
import love.distributedrebirth.numberxd.base2t.facet.BaseFacetKey;
import love.distributedrebirth.numberxd.base2t.facet.BasePartAlt1;
import love.distributedrebirth.numberxd.base2t.facet.BasePartSplit4;
/**
* The distribution by 4.
*
* @author willemtsade ©Δ 仙上主天
*/
public enum T04PartQuad implements BasePart,BasePartAlt1,BasePartSplit4 {
PART_1("˥","0","","north","N"),
PART_2("","1","","east", "E"),
PART_3("","2","西","west", "W"),
PART_4("˩","3","","south","S"),
;
public static int LENGTH = 4;
private final Map<BaseFacetKey, Object> facetStore = new HashMap<>();
private static final String ALT_1_NAME = "Cardinal direction";
private static final String ALT_1_WIKI = "https://simple.wikipedia.org/wiki/Cardinal_direction";
private static final Map<String, T04PartQuad> TONE_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v)));
private static final Map<String, T04PartQuad> CHINA_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getChinaKey(), v -> v)));
private T04PartQuad(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) {
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);
this.getFacetStore().put(BaseFacetKey.ALT_1_VALUE, alt1Value);
this.getFacetStore().put(BaseFacetKey.ALT_1_NAME, ALT_1_NAME);
this.getFacetStore().put(BaseFacetKey.ALT_1_WIKI, ALT_1_WIKI);
}
@Override
public Map<BaseFacetKey, Object> getFacetStore() {
return facetStore;
}
public static void forEach(Consumer<T04PartQuad> 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);
}
}

View file

@ -0,0 +1,59 @@
package love.distributedrebirth.numberxd.base2t;
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.numberxd.base2t.facet.BasePart;
import love.distributedrebirth.numberxd.base2t.facet.BaseFacetKey;
/**
* The distribution by 5 called Wuxing.
*
* @author willemtsade ©Δ 仙上主天
*/
public enum T05PartPental implements BasePart {
PART_1("˥","0","","fire"),
PART_2("˦","1","","water"),
PART_3("˧","2","","wood"),
PART_4("˨","3","","gold"),
PART_5("˩","4","","earth"),
;
public static int LENGTH = 5;
private final Map<BaseFacetKey, Object> facetStore = new HashMap<>();
private static final Map<String, T05PartPental> TONE_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v)));
private static final Map<String, T05PartPental> CHINA_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getChinaKey(), v -> v)));
private T05PartPental(String idTone, String idLetter, String chinaKey, String chinaValue) {
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<T05PartPental> consumer) {
for (T05PartPental value:values()) {
consumer.accept(value);
}
}
public static T05PartPental valueOfTone(String identifierTone) {
return TONE_MAP.get(identifierTone);
}
public static T05PartPental valueOfChina(String chinaKey) {
return CHINA_MAP.get(chinaKey);
}
}

View file

@ -0,0 +1,69 @@
package love.distributedrebirth.numberxd.base2t;
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.numberxd.base2t.facet.BasePart;
import love.distributedrebirth.numberxd.base2t.facet.BaseFacetKey;
import love.distributedrebirth.numberxd.base2t.facet.BasePartAlt1;
import love.distributedrebirth.numberxd.base2t.facet.BasePartSplit6;
/**
* The distribution by 6.
*
* NOTE: The sexi karlson-speaker is china design 3=6 and 6=9 and in quad space, zero is the result.
*
* @author willemtsade ©Δ 仙上主天
*/
public enum T06PartSeximal implements BasePart,BasePartAlt1,BasePartSplit6 {
PART_1("˦","0","","4","A"),
PART_2("˨","1","","5","D"),
PART_3("","2","","6","F"),
PART_4("","3","","7","G"),
PART_5("","4","","8","V"),
PART_6("","5","","9","X"),
;
public static int LENGTH = 6;
private final Map<BaseFacetKey, Object> facetStore = new HashMap<>();
private static final String ALT_1_NAME = "ADFGVX cipher";
private static final String ALT_1_WIKI = "https://en.wikipedia.org/wiki/ADFGVX_cipher";
private static final Map<String, T06PartSeximal> TONE_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v)));
private static final Map<String, T06PartSeximal> CHINA_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getChinaKey(), v -> v)));
private T06PartSeximal(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) {
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);
this.getFacetStore().put(BaseFacetKey.ALT_1_VALUE, alt1Value);
this.getFacetStore().put(BaseFacetKey.ALT_1_NAME, ALT_1_NAME);
this.getFacetStore().put(BaseFacetKey.ALT_1_WIKI, ALT_1_WIKI);
}
@Override
public Map<BaseFacetKey, Object> getFacetStore() {
return facetStore;
}
public static void forEach(Consumer<T06PartSeximal> consumer) {
for (T06PartSeximal value:values()) {
consumer.accept(value);
}
}
public static T06PartSeximal valueOfTone(String identifierTone) {
return TONE_MAP.get(identifierTone);
}
public static T06PartSeximal valueOfChina(String chinaKey) {
return CHINA_MAP.get(chinaKey);
}
}

View file

@ -0,0 +1,82 @@
package love.distributedrebirth.numberxd.base2t;
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.numberxd.base2t.facet.BasePart;
import love.distributedrebirth.numberxd.base2t.facet.BaseFacetKey;
import love.distributedrebirth.numberxd.base2t.facet.BasePartAlt2;
import love.distributedrebirth.numberxd.base2t.facet.BasePartSplit8;
/**
* The distribution by 8.
*
* @author willemtsade ©Δ 仙上主天
*/
public enum T08PartOctal implements BasePart,BasePartAlt2,BasePartSplit8 {
PART_1("˥","0","","heart","˧˥˩","˥˩˧", 0),
PART_2("˩","1","","head", "˧˩˥","˩˥˧", 3),
PART_3("","2","","eye", "˧˥˦","˥˦˧", 6),
PART_4("","3","","mouth","˧˩˨","˩˨˧", 9),
PART_5("","4","","arm", "˧˦˦","˦˦˧", 12),
PART_6("","5","","hand", "˧˨˨","˨˨˧", 15),
PART_7("","6","","leg", "˧˥˥","˥˥˧", 18),
PART_8("","7","","feet", "˧˩˩","˩˩˧", 21),
;
public static int LENGTH = 8;
public static int BIT_COUNT = 3;
private static final byte BITMASK = 0x07;
private final Map<BaseFacetKey, Object> facetStore = new HashMap<>();
private static final String ALT_1_NAME = "Absolute Tone Sequence";
private static final String ALT_1_WIKI = "https://en.wikipedia.org/wiki/Tone_letter";
private static final String ALT_2_NAME = "Relative Tone Sequence";
private static final String ALT_2_WIKI = "https://en.wikipedia.org/wiki/Tone_letter";
private static final Map<String, T08PartOctal> TONE_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v)));
private static final Map<String, T08PartOctal> CHINA_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getChinaKey(), v -> v)));
private T08PartOctal(String identifierTone, String identifierLetter, String chinaKey, String chinaValue, String alt1Value, String alt2Value, int shiftBits) {
this.getFacetStore().put(BaseFacetKey.ID_TONE, identifierTone);
this.getFacetStore().put(BaseFacetKey.ID_LETTER, identifierLetter);
this.getFacetStore().put(BaseFacetKey.CHINA_KEY, chinaKey);
this.getFacetStore().put(BaseFacetKey.CHINA_VALUE, chinaValue);
this.getFacetStore().put(BaseFacetKey.SHIFT_BITS, Integer.valueOf(shiftBits));
this.getFacetStore().put(BaseFacetKey.ALT_1_VALUE, alt1Value);
this.getFacetStore().put(BaseFacetKey.ALT_1_NAME, ALT_1_NAME);
this.getFacetStore().put(BaseFacetKey.ALT_1_WIKI, ALT_1_WIKI);
this.getFacetStore().put(BaseFacetKey.ALT_2_VALUE, alt2Value);
this.getFacetStore().put(BaseFacetKey.ALT_2_NAME, ALT_2_NAME);
this.getFacetStore().put(BaseFacetKey.ALT_2_WIKI, ALT_2_WIKI);
}
@Override
public Map<BaseFacetKey, Object> getFacetStore() {
return facetStore;
}
public static T08PartOctal indexOf(T08PartOctal group, int value) {
return T08PartOctal.values()[(value >> group.getShiftBits()) & BITMASK];
}
public static void forEach(Consumer<T08PartOctal> consumer) {
for (T08PartOctal value:values()) {
consumer.accept(value);
}
}
public static T08PartOctal valueOfTone(String identifierTone) {
return TONE_MAP.get(identifierTone);
}
public static T08PartOctal valueOfChina(String chinaKey) {
return CHINA_MAP.get(chinaKey);
}
}

View file

@ -0,0 +1,22 @@
package love.distributedrebirth.numberxd.base2t;
import java.util.Collection;
/**
* Appender model for Octals.
*
* @author willemtsade ©Δ 仙上主天
*/
public final class T08PartOctalBaseAppender implements BaseAppender<T08PartOctal> {
private final Collection<T08PartOctal> collection;
public T08PartOctalBaseAppender(Collection<T08PartOctal> collection) {
this.collection = collection;
}
@Override
public void add(T08PartOctal value) {
collection.add(value);
}
}

View file

@ -0,0 +1,27 @@
package love.distributedrebirth.numberxd.base2t;
import java.util.Iterator;
/**
* Iterator model for Octals.
*
* @author willemtsade ©Δ 仙上主天
*/
public final class T08PartOctalBaseIterator implements Iterator<T08PartOctal> {
private final Iterator<T08PartOctal> iterator;
public T08PartOctalBaseIterator(Iterator<T08PartOctal> iterator) {
this.iterator = iterator;
}
@Override
public boolean hasNext() {
return iterator.hasNext();
}
@Override
public T08PartOctal next() {
return iterator.next();
}
}

View file

@ -0,0 +1,72 @@
package love.distributedrebirth.numberxd.base2t;
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.numberxd.base2t.facet.BasePart;
import love.distributedrebirth.numberxd.base2t.facet.BaseFacetKey;
import love.distributedrebirth.numberxd.base2t.facet.BasePartAlt1;
/**
* The distribution by 12.
*
* @author willemtsade ©Δ 仙上主天
*/
public enum T12PartUncial implements BasePart,BasePartAlt1 {
PART_1 ("˥","0","","sun","0"),
PART_2 ("˧","1","","moon","1"),
PART_3 ("˩","2","","star","2"),
PART_4 ("","3","","mountain","3"),
PART_5 ("","4","","dragon","4"),
PART_6 ("","5","","phoenix","5"),
PART_7 ("","6","","cup","6"),
PART_8 ("","7","","pondweed","7"),
PART_9 ("","8","","furnace","8"),
PART_10("","9","","seed","9"),
PART_11("","A","","axe","\u218a"), // TURNED DIGIT TWO
PART_12("","B","","nozero","\u218b"), // TURNED DIGIT THREE
;
public static int LENGTH = 12;
private final Map<BaseFacetKey, Object> facetStore = new HashMap<>();
private static final String ALT_1_NAME = "Transdecimal symbols";
private static final String ALT_1_WIKI = "https://en.wikipedia.org/wiki/Duodecimal#Transdecimal_symbols";
private static final Map<String, T12PartUncial> TONE_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v)));
private static final Map<String, T12PartUncial> CHINA_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getChinaKey(), v -> v)));
private T12PartUncial(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) {
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);
this.getFacetStore().put(BaseFacetKey.ALT_1_VALUE, alt1Value);
this.getFacetStore().put(BaseFacetKey.ALT_1_NAME, ALT_1_NAME);
this.getFacetStore().put(BaseFacetKey.ALT_1_WIKI, ALT_1_WIKI);
}
@Override
public Map<BaseFacetKey, Object> getFacetStore() {
return facetStore;
}
public static void forEach(Consumer<T12PartUncial> consumer) {
for (T12PartUncial value:values()) {
consumer.accept(value);
}
}
public static T12PartUncial valueOfTone(String identifierTone) {
return TONE_MAP.get(identifierTone);
}
public static T12PartUncial valueOfChina(String chinaKey) {
return CHINA_MAP.get(chinaKey);
}
}

View file

@ -0,0 +1,77 @@
package love.distributedrebirth.numberxd.base2t;
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.numberxd.base2t.facet.BasePart;
import love.distributedrebirth.numberxd.base2t.facet.BaseFacetKey;
import love.distributedrebirth.numberxd.base2t.facet.BasePartAlt1;
import love.distributedrebirth.numberxd.base2t.facet.BasePartSplit16;
/**
* The distribution by 16.
*
* @author willemtsade ©Δ 仙上主天
*/
public enum T16PartHex implements BasePart,BasePartAlt1,BasePartSplit16 {
PART_1 ("˥","0","","hydrogen","1"),
PART_2 ("˦","1","","helium","2"),
PART_3 ("˨","2","","lithium","3"),
PART_4 ("˩","3","","beryllium","A"),
PART_5 ("","4","","boron","4"),
PART_6 ("","5","","carbon","5"),
PART_7 ("","6","","nitrogen","6"),
PART_8 ("","7","","oxygen","B"),
PART_9 ("","8","","fluorine","7"),
PART_10("","9","","neon","8"),
PART_11("","A","","sodium","9"),
PART_12("","B","","magnesium","C"),
PART_13("","C","","aluminium","*"),
PART_14("","D","","silicon","0"),
PART_15("","E","","phosphorus","#"),
PART_16("","F","","sulfur","D"),
;
public static int LENGTH = 16;
private final Map<BaseFacetKey, Object> facetStore = new HashMap<>();
private static final String ALT_1_NAME = "Dual-tone multi-frequency signaling";
private static final String ALT_1_WIKI = "https://en.wikipedia.org/wiki/Dual-tone_multi-frequency_signaling";
private static final Map<String, T16PartHex> TONE_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v)));
private static final Map<String, T16PartHex> CHINA_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getChinaKey(), v -> v)));
private T16PartHex(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) {
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);
this.getFacetStore().put(BaseFacetKey.ALT_1_VALUE, alt1Value);
this.getFacetStore().put(BaseFacetKey.ALT_1_NAME, ALT_1_NAME);
this.getFacetStore().put(BaseFacetKey.ALT_1_WIKI, ALT_1_WIKI);
}
@Override
public Map<BaseFacetKey, Object> getFacetStore() {
return facetStore;
}
public static void forEach(Consumer<T16PartHex> 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);
}
}

View file

@ -0,0 +1,80 @@
package love.distributedrebirth.numberxd.base2t;
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.numberxd.base2t.facet.BasePart;
import love.distributedrebirth.numberxd.base2t.facet.BaseFacetKey;
import love.distributedrebirth.numberxd.base2t.facet.BasePartAlt1;
/**
* The distribution by 20.
*
* @author willemtsade ©Δ 仙上主天
*/
public enum T20PartScore implements BasePart,BasePartAlt1 {
PART_1 ("˥","0","","yotta","2"),
PART_2 ("˦","1","","zetta","3"),
PART_3 ("˧","2","","exa", "4"),
PART_4 ("˨","3","","peta", "5"),
PART_5 ("˩","4","","tera", "6"),
PART_6 ("","5","","giga", "7"),
PART_7 ("","6","","mega", "8"),
PART_8 ("","7","","kilo", "9"),
PART_9 ("","8","","hecto","C"),
PART_10("","9","","deca", "F"),
PART_11("","A","","deci", "G"),
PART_12("","B","","centi","H"),
PART_13("","C","","milli","J"),
PART_14("","D","","micro","M"),
PART_15("","E","","nano", "P"),
PART_16("","F","","pico", "Q"),
PART_17("","G","","femto","R"),
PART_18("","H","","atto", "V"),
PART_19("","I","","zepto","W"),
PART_20("","J","","yocto","X"),
;
public static int LENGTH = 20;
private final Map<BaseFacetKey, Object> facetStore = new HashMap<>();
private static final String ALT_1_NAME = "Open Location Code";
private static final String ALT_1_WIKI = "https://en.wikipedia.org/wiki/Open_Location_Code";
private static final Map<String, T20PartScore> TONE_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getIdentifierTone(), v -> v)));
private static final Map<String, T20PartScore> CHINA_MAP = Collections.unmodifiableMap(
Arrays.asList(values()).stream().collect(Collectors.toMap(v -> v.getChinaKey(), v -> v)));
private T20PartScore(String idTone, String idLetter, String chinaKey, String chinaValue, String alt1Value) {
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);
this.getFacetStore().put(BaseFacetKey.ALT_1_VALUE, alt1Value);
this.getFacetStore().put(BaseFacetKey.ALT_1_NAME, ALT_1_NAME);
this.getFacetStore().put(BaseFacetKey.ALT_1_WIKI, ALT_1_WIKI);
}
@Override
public Map<BaseFacetKey, Object> getFacetStore() {
return facetStore;
}
public static void forEach(Consumer<T20PartScore> 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);
}
}

View file

@ -0,0 +1,117 @@
package love.distributedrebirth.numberxd.base2t;
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.numberxd.base2t.facet.BasePart;
import love.distributedrebirth.numberxd.base2t.facet.BaseFacetKey;
/**
* The distribution by 60.
*
* @author willemtsade ©Δ 仙上主天
*/
public enum T60Sexagesimal implements BasePart {
PART_1 ("˧˩˥","ια","","cow"),
PART_2 ("˧˥˦","ιβ","","chicken"),
PART_3 ("˧˩˨","ιγ","","sheep"),
PART_4 ("˧˦˦","ιδ","","wolf"),
PART_5 ("˧˨˨","ιε","","rat"),
PART_6 ("˧˥˥","ιϚ","","cat"),
PART_7 ("˧˩˩","ιζ","","rabbit"),
PART_8 ("˥˩˧","ιη","","ape"),
PART_9 ("˩˥˧","ιθ","","snake"),
PART_10("˥˦˧","κα","","horse"),
PART_11("˩˨˧","κβ","","elepant"),
PART_12("˦˦˧","κγ","","leopard"),
PART_13("˨˨˧","κδ","","crow"),
PART_14("˥˥˧","κε","","pig"),
PART_15("˩˩˧","κϚ","","dog"),
PART_16("꜔꜒꜖","κζ","","fish"),
PART_17("꜔꜒꜓","κη","","shrimp"),
PART_18("꜔꜖꜕","κθ","","whale"),
PART_19("꜔꜓꜓","λα","","bear"),
PART_20("꜔꜕꜕","λβ","鹿","deer"),
PART_21("꜔꜒꜒","λγ","","donkey"),
PART_22("꜔꜖꜖","λδ","","tapir"),
PART_23("꜒꜖꜔","λε","","bird"),
PART_24("꜖꜒꜔","λϚ","","crane"),
PART_25("꜒꜓꜔","λζ","","eagle"),
PART_26("꜖꜕꜔","λη","","falcon"),
PART_27("꜓꜓꜔","λθ","","goose"),
PART_28("꜕꜕꜔","μα","","salamander"),
PART_29("꜒꜒꜔","μβ","","turtle"),
PART_30("꜖꜖꜔","μγ","","centipede"),
PART_31("꜊꜌꜈","μδ","","fly"),
PART_32("꜊꜈꜉","με","","scorpion"),
PART_33("꜊꜌꜋","μϚ","","worm"),
PART_34("꜊꜉꜉","μζ","","tiger"),
PART_35("꜊꜋꜋","μη","","camel"),
PART_36("꜊꜈꜈","μθ","","monkey"),
PART_37("꜊꜌꜌","να","","shark"),
PART_38("꜈꜌꜊","νβ","","duck"),
PART_39("꜌꜈꜊","νγ","","mustard"),
PART_40("꜈꜉꜊","νδ","","salt"),
PART_41("꜌꜋꜊","νε","","pepper"),
PART_42("꜉꜉꜊","νϚ","","ginger"),
PART_43("꜋꜋꜊","νζ","","corn"),
PART_44("꜈꜈꜊","νη","","beans"),
PART_45("꜌꜌꜊","νθ","","pomelos"),
PART_46("꜏꜍꜑","ξα","","jujube"),
PART_47("꜏꜍꜎","ξβ","","melon"),
PART_48("꜏꜑꜐","ξγ","","grape"),
PART_49("꜏꜎꜎","ξδ","","plum"),
PART_50("꜏꜐꜐","ξε","","lime"),
PART_51("꜏꜍꜍","ξϚ","","pear"),
PART_52("꜏꜑꜑","ξζ","","banana"),
PART_53("꜍꜑꜏","ξη","","lemon"),
PART_54("꜑꜍꜏","ξθ","","persimmon"),
PART_55("꜍꜎꜏","οα","","orange"),
PART_56("꜑꜐꜏","οβ","","peach"),
PART_57("꜎꜎꜏","ογ","","apricot"),
PART_58("꜐꜐꜏","οδ","","strawberry"),
PART_59("꜍꜍꜏","οε","","patato"),
PART_60("꜑꜑꜏","οϚ","","apple"),
;
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

@ -0,0 +1,43 @@
package love.distributedrebirth.numberxd.base2t;
/**
* Holds an 3 bit value.
*
* @author willemtsade ©Δ 仙上主天
*/
public final class V003Timble implements BaseNumber<V003Timble> {
public static int BIT_COUNT = T08PartOctal.BIT_COUNT;
private final T08PartOctal value;
public V003Timble() {
this(T08PartOctal.PART_1);
}
public V003Timble(T08PartOctalBaseIterator values) {
this(values.next());
}
public V003Timble(T08PartOctal value) {
this.value = value;
}
public T08PartOctal getValue() {
return value;
}
@Override
public int getBitCount() {
return BIT_COUNT;
}
@Override
public V003Timble toClone() {
return new V003Timble(getValue());
}
@Override
public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
appender.add(getValue());
}
}

View file

@ -0,0 +1,48 @@
package love.distributedrebirth.numberxd.base2t;
/**
* Holds an 6 bit value.
*
* @author willemtsade ©Δ 仙上主天
*/
public final class V006Tixte implements BaseNumber<V006Tixte> {
public static int BIT_COUNT = V003Timble.BIT_COUNT * T02PartBinary.LENGTH;
private V003Timble[] values = new V003Timble[T02PartBinary.LENGTH];
public V006Tixte() {
this(new V003Timble(), new V003Timble());
}
public V006Tixte(T08PartOctalBaseIterator values) {
this(new V003Timble(values), new V003Timble(values));
}
private V006Tixte(V003Timble valueHigh, V003Timble valueLow) {
setValue(T02PartBinary.PART_1, valueHigh);
setValue(T02PartBinary.PART_2, valueLow);
}
public V003Timble getValue(T02PartBinary part) {
return values[part.ordinal()];
}
public void setValue(T02PartBinary part, V003Timble value) {
values[part.ordinal()] = value;
}
@Override
public int getBitCount() {
return BIT_COUNT;
}
@Override
public V006Tixte toClone() {
return new V006Tixte(iteratorOctalsByClone());
}
@Override
public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillOctalsByClone(appender));
}
}

View file

@ -0,0 +1,54 @@
package love.distributedrebirth.numberxd.base2t;
/**
* Holds an 9 bit value.
*
* @author willemtsade ©Δ 仙上主天
*/
public final class V009Tyte implements BaseNumberTyte<V009Tyte> {
public static int BIT_COUNT = V003Timble.BIT_COUNT * T03PartTrit.LENGTH;
private final V003Timble[] values = new V003Timble[T03PartTrit.LENGTH];
public V009Tyte() {
this(new V003Timble(), new V003Timble(), new V003Timble());
}
public V009Tyte(T08PartOctalBaseIterator values) {
this(new V003Timble(values), new V003Timble(values), new V003Timble(values));
}
public V009Tyte(T08PartOctal valueHigh, T08PartOctal valueMedium, T08PartOctal valueLow) {
this(new V003Timble(valueHigh), new V003Timble(valueMedium), new V003Timble(valueLow));
}
private V009Tyte(V003Timble valueHigh, V003Timble valueMedium, V003Timble valueLow) {
values[T03PartTrit.PART_1.ordinal()] = valueHigh;
values[T03PartTrit.PART_2.ordinal()] = valueMedium;
values[T03PartTrit.PART_3.ordinal()] = valueLow;
}
public V003Timble getValue(T03PartTrit part) {
return values[part.ordinal()];
}
@Override
public int getBitCount() {
return BIT_COUNT;
}
@Override
public V009Tyte toClone() {
return new V009Tyte(iteratorOctalsByClone());
}
@Override
public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T03PartTrit.forEach(v -> getValue(v).fillOctalsByClone(appender));
}
@Override
public void fillTytesByReference(V009TyteBaseAppender appender) {
appender.add(this);
}
}

View file

@ -0,0 +1,22 @@
package love.distributedrebirth.numberxd.base2t;
import java.util.Collection;
/**
* Appender model for Tytes.
*
* @author willemtsade ©Δ 仙上主天
*/
public final class V009TyteBaseAppender implements BaseAppender<V009Tyte> {
private final Collection<V009Tyte> collection;
public V009TyteBaseAppender(Collection<V009Tyte> collection) {
this.collection = collection;
}
@Override
public void add(V009Tyte value) {
collection.add(value);
}
}

View file

@ -0,0 +1,27 @@
package love.distributedrebirth.numberxd.base2t;
import java.util.Iterator;
/**
* Iterator model for Tytes.
*
* @author willemtsade ©Δ 仙上主天
*/
public final class V009TyteBaseIterator implements Iterator<V009Tyte> {
private final Iterator<V009Tyte> iterator;
public V009TyteBaseIterator(Iterator<V009Tyte> iterator) {
this.iterator = iterator;
}
@Override
public boolean hasNext() {
return iterator.hasNext();
}
@Override
public V009Tyte next() {
return iterator.next();
}
}

View file

@ -0,0 +1,61 @@
package love.distributedrebirth.numberxd.base2t;
/**
* Holds an 18 bit value.
*
* @author willemtsade ©Δ 仙上主天
*/
public final class V012Tord implements BaseNumberTyte<V012Tord> {
public static int BIT_COUNT = V009Tyte.BIT_COUNT * T02PartBinary.LENGTH;
private V009Tyte[] values = new V009Tyte[T02PartBinary.LENGTH];
public V012Tord() {
this(new V009Tyte(), new V009Tyte());
}
public V012Tord(T08PartOctalBaseIterator values) {
this(new V009Tyte(values), new V009Tyte(values));
}
public V012Tord(V009TyteBaseIterator values) {
this(values.next(), values.next());
}
private V012Tord(V009Tyte valueHigh, V009Tyte valueLow) {
setValue(T02PartBinary.PART_1, valueHigh);
setValue(T02PartBinary.PART_2, valueLow);
}
public V009Tyte getValue(T02PartBinary part) {
return values[part.ordinal()];
}
public void setValue(T02PartBinary part, V009Tyte value) {
values[part.ordinal()] = value;
}
public V003Timble getTimblePart(T06PartSeximal part) {
return getValue(part.splitPartBinary()).getValue(part.splitPartTrit());
}
@Override
public int getBitCount() {
return BIT_COUNT;
}
@Override
public V012Tord toClone() {
return new V012Tord(iteratorOctalsByClone());
}
@Override
public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillOctalsByClone(appender));
}
@Override
public void fillTytesByReference(V009TyteBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillTytesByReference(appender));
}
}

View file

@ -0,0 +1,58 @@
package love.distributedrebirth.numberxd.base2t;
/**
* Holds an 27 bit value.
*
* @author willemtsade ©Δ 仙上主天
*/
public final class V01BTemvig implements BaseNumberTyte<V01BTemvig> {
public static int BIT_COUNT = V009Tyte.BIT_COUNT * T03PartTrit.LENGTH;
private V009Tyte[] values = new V009Tyte[T03PartTrit.LENGTH];
public V01BTemvig() {
this(new V009Tyte(), new V009Tyte(), new V009Tyte());
}
public V01BTemvig(T08PartOctalBaseIterator values) {
this(new V009Tyte(values), new V009Tyte(values), new V009Tyte(values));
}
public V01BTemvig(V009TyteBaseIterator values) {
this(values.next(), values.next(), values.next());
}
private V01BTemvig(V009Tyte valueHigh, V009Tyte valueMedium, V009Tyte valueLow) {
setValue(T03PartTrit.PART_1, valueHigh);
setValue(T03PartTrit.PART_2, valueMedium);
setValue(T03PartTrit.PART_3, valueLow);
}
public V009Tyte getValue(T03PartTrit part) {
return values[part.ordinal()];
}
public void setValue(T03PartTrit part, V009Tyte value) {
values[part.ordinal()] = value;
}
@Override
public int getBitCount() {
return BIT_COUNT;
}
@Override
public V01BTemvig toClone() {
return new V01BTemvig(iteratorOctalsByClone());
}
@Override
public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T03PartTrit.forEach(v -> getValue(v).fillOctalsByClone(appender));
}
@Override
public void fillTytesByReference(V009TyteBaseAppender appender) {
T03PartTrit.forEach(v -> getValue(v).fillTytesByReference(appender));
}
}

View file

@ -0,0 +1,67 @@
package love.distributedrebirth.numberxd.base2t;
/**
* Holds an 36 bit value.
*
* @author willemtsade ©Δ 仙上主天
*/
public final class V024Teger implements BaseNumberTyte<V024Teger> {
public static int BIT_COUNT = V012Tord.BIT_COUNT * T02PartBinary.LENGTH;
private V012Tord[] values = new V012Tord[T02PartBinary.LENGTH];
public V024Teger() {
this(new V012Tord(), new V012Tord());
}
public V024Teger(T08PartOctalBaseIterator values) {
this(new V012Tord(values), new V012Tord(values));
}
public V024Teger(V009TyteBaseIterator values) {
this(new V012Tord(values), new V012Tord(values));
}
private V024Teger(V012Tord valueHigh, V012Tord valueLow) {
setValue(T02PartBinary.PART_1, valueHigh);
setValue(T02PartBinary.PART_2, valueLow);
}
public V012Tord getValue(T02PartBinary part) {
return values[part.ordinal()];
}
public void setValue(T02PartBinary part, V012Tord value) {
values[part.ordinal()] = value;
}
public V009Tyte getTytePart(T04PartQuad part) {
return getValue(part.splitPartBinary(T02PartBinary.PART_1))
.getValue(part.splitPartBinary(T02PartBinary.PART_2));
}
public void setTytePart(T04PartQuad part, V009Tyte value) {
getValue(part.splitPartBinary(T02PartBinary.PART_1))
.setValue(part.splitPartBinary(T02PartBinary.PART_2), value);
}
@Override
public int getBitCount() {
return BIT_COUNT;
}
@Override
public V024Teger toClone() {
return new V024Teger(iteratorOctalsByClone());
}
@Override
public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillOctalsByClone(appender));
}
@Override
public void fillTytesByReference(V009TyteBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillTytesByReference(appender));
}
}

View file

@ -0,0 +1,69 @@
package love.distributedrebirth.numberxd.base2t;
/**
* Holds an 72 bit value.
*
* @author willemtsade ©Δ 仙上主天
*/
public final class V048Tong implements BaseNumberTyte<V048Tong> {
public static int BIT_COUNT = V024Teger.BIT_COUNT * T02PartBinary.LENGTH;
private V024Teger[] values = new V024Teger[T02PartBinary.LENGTH];
public V048Tong() {
this(new V024Teger(), new V024Teger());
}
public V048Tong(T08PartOctalBaseIterator values) {
this(new V024Teger(values), new V024Teger(values));
}
public V048Tong(V009TyteBaseIterator values) {
this(new V024Teger(values), new V024Teger(values));
}
private V048Tong(V024Teger valueHigh, V024Teger valueLow) {
setValue(T02PartBinary.PART_1, valueHigh);
setValue(T02PartBinary.PART_2, valueLow);
}
public V024Teger getValue(T02PartBinary part) {
return values[part.ordinal()];
}
public void setValue(T02PartBinary part, V024Teger value) {
values[part.ordinal()] = value;
}
public V009Tyte getTytePart(T08PartOctal part) {
return getValue(part.splitPartBinary(T03PartTrit.PART_1))
.getValue(part.splitPartBinary(T03PartTrit.PART_2))
.getValue(part.splitPartBinary(T03PartTrit.PART_3));
}
public void setTytePart(T08PartOctal part, V009Tyte value) {
getValue(part.splitPartBinary(T03PartTrit.PART_1))
.getValue(part.splitPartBinary(T03PartTrit.PART_2))
.setValue(part.splitPartBinary(T03PartTrit.PART_3), value);
}
@Override
public int getBitCount() {
return BIT_COUNT;
}
@Override
public V048Tong toClone() {
return new V048Tong(iteratorOctalsByClone());
}
@Override
public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillOctalsByClone(appender));
}
@Override
public void fillTytesByReference(V009TyteBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillTytesByReference(appender));
}
}

View file

@ -0,0 +1,83 @@
package love.distributedrebirth.numberxd.base2t;
/**
* Holds an 144 bit value.
*
* @author willemtsade ©Δ 仙上主天
*/
public final class V090Tocta implements BaseNumberTyte<V090Tocta> {
public static int BIT_COUNT = V048Tong.BIT_COUNT * T02PartBinary.LENGTH;
private V048Tong[] values = new V048Tong[T02PartBinary.LENGTH];
public V090Tocta() {
this(new V048Tong(), new V048Tong());
}
public V090Tocta(T08PartOctalBaseIterator values) {
this(new V048Tong(values), new V048Tong(values));
}
public V090Tocta(V009TyteBaseIterator values) {
this(new V048Tong(values), new V048Tong(values));
}
private V090Tocta(V048Tong valueHigh, V048Tong valueLow) {
setValue(T02PartBinary.PART_1, valueHigh);
setValue(T02PartBinary.PART_2, valueLow);
}
public V048Tong getValue(T02PartBinary part) {
return values[part.ordinal()];
}
public void setValue(T02PartBinary part, V048Tong value) {
values[part.ordinal()] = value;
}
public V009Tyte getTytePart(T16PartHex part) {
return getValue(part.splitPartBinary(T04PartQuad.PART_1))
.getValue(part.splitPartBinary(T04PartQuad.PART_2))
.getValue(part.splitPartBinary(T04PartQuad.PART_3))
.getValue(part.splitPartBinary(T04PartQuad.PART_4));
}
public void setTytePart(T16PartHex part, V009Tyte value) {
getValue(part.splitPartBinary(T04PartQuad.PART_1))
.getValue(part.splitPartBinary(T04PartQuad.PART_2))
.getValue(part.splitPartBinary(T04PartQuad.PART_3))
.setValue(part.splitPartBinary(T04PartQuad.PART_4), value);
}
public V012Tord getTordPart(T08PartOctal part) {
return getValue(part.splitPartBinary(T03PartTrit.PART_1))
.getValue(part.splitPartBinary(T03PartTrit.PART_2))
.getValue(part.splitPartBinary(T03PartTrit.PART_3));
}
public void setTordPart(T08PartOctal part, V012Tord value) {
getValue(part.splitPartBinary(T03PartTrit.PART_1))
.getValue(part.splitPartBinary(T03PartTrit.PART_2))
.setValue(part.splitPartBinary(T03PartTrit.PART_3), value);
}
@Override
public int getBitCount() {
return BIT_COUNT;
}
@Override
public V090Tocta toClone() {
return new V090Tocta(iteratorOctalsByClone());
}
@Override
public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillOctalsByClone(appender));
}
@Override
public void fillTytesByReference(V009TyteBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillTytesByReference(appender));
}
}

View file

@ -0,0 +1,52 @@
package love.distributedrebirth.numberxd.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(iteratorOctalsByClone());
}
@Override
public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T60Sexagesimal.forEach(v -> getValue(v).fillOctalsByClone(appender));
}
@Override
public void fillTytesByReference(V009TyteBaseAppender appender) {
T60Sexagesimal.forEach(v -> getValue(v).fillTytesByReference(appender));
}
}

View file

@ -0,0 +1,53 @@
package love.distributedrebirth.numberxd.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(iteratorOctalsByClone());
}
@Override
public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillOctalsByClone(appender));
}
@Override
public void fillTytesByReference(V009TyteBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillTytesByReference(appender));
}
}

View file

@ -0,0 +1,29 @@
package love.distributedrebirth.numberxd.base2t.facet;
/**
*
*
* @author willemtsade ©Δ 仙上主天
*/
public enum BaseFacetKey {
ID_TONE,
ID_LETTER,
CHINA_KEY,
CHINA_VALUE,
SHIFT_BITS,
ALT_1_VALUE,
ALT_1_NAME,
ALT_1_WIKI,
ALT_2_VALUE,
ALT_2_NAME,
ALT_2_WIKI,
ALT_3_VALUE,
ALT_3_NAME,
ALT_3_WIKI,
ALT_4_VALUE,
ALT_4_NAME,
ALT_4_WIKI,
;
}

View file

@ -0,0 +1,13 @@
package love.distributedrebirth.numberxd.base2t.facet;
import java.util.Map;
/**
*
*
* @author willemtsade ©Δ 仙上主天
*/
public interface BaseFacetStore {
Map<BaseFacetKey, Object> getFacetStore();
}

View file

@ -0,0 +1,27 @@
package love.distributedrebirth.numberxd.base2t.facet;
/**
*
*
* @author willemtsade ©Δ 仙上主天
*/
public interface BasePart extends BaseFacetStore {
int ordinal();
default String getIdentifierTone() {
return (String)getFacetStore().get(BaseFacetKey.ID_TONE);
}
default String getIdentifierLetter() {
return (String)getFacetStore().get(BaseFacetKey.ID_LETTER);
}
default String getChinaKey() {
return (String)getFacetStore().get(BaseFacetKey.CHINA_KEY);
}
default String getChinaValue() {
return (String)getFacetStore().get(BaseFacetKey.CHINA_VALUE);
}
}

View file

@ -0,0 +1,21 @@
package love.distributedrebirth.numberxd.base2t.facet;
/**
*
*
* @author willemtsade ©Δ 仙上主天
*/
public interface BasePartAlt1 extends BasePart {
default String getAlt1Value() {
return (String)getFacetStore().get(BaseFacetKey.ALT_1_VALUE);
}
default String getAlt1Name() {
return (String)getFacetStore().get(BaseFacetKey.ALT_1_NAME);
}
default String getAlt1Wiki() {
return (String)getFacetStore().get(BaseFacetKey.ALT_1_WIKI);
}
}

View file

@ -0,0 +1,21 @@
package love.distributedrebirth.numberxd.base2t.facet;
/**
*
*
* @author willemtsade ©Δ 仙上主天
*/
public interface BasePartAlt2 extends BasePartAlt1 {
default String getAlt2Value() {
return (String)getFacetStore().get(BaseFacetKey.ALT_2_VALUE);
}
default String getAlt2Name() {
return (String)getFacetStore().get(BaseFacetKey.ALT_2_NAME);
}
default String getAlt2Wiki() {
return (String)getFacetStore().get(BaseFacetKey.ALT_2_WIKI);
}
}

View file

@ -0,0 +1,21 @@
package love.distributedrebirth.numberxd.base2t.facet;
/**
*
*
* @author willemtsade ©Δ 仙上主天
*/
public interface BasePartAlt3 extends BasePartAlt2 {
default String getAlt3Value() {
return (String)getFacetStore().get(BaseFacetKey.ALT_3_VALUE);
}
default String getAlt3Name() {
return (String)getFacetStore().get(BaseFacetKey.ALT_3_NAME);
}
default String getAlt3Wiki() {
return (String)getFacetStore().get(BaseFacetKey.ALT_3_WIKI);
}
}

View file

@ -0,0 +1,21 @@
package love.distributedrebirth.numberxd.base2t.facet;
/**
*
*
* @author willemtsade ©Δ 仙上主天
*/
public interface BasePartAlt4 extends BasePartAlt3 {
default String getAlt4Value() {
return (String)getFacetStore().get(BaseFacetKey.ALT_4_VALUE);
}
default String getAlt4Name() {
return (String)getFacetStore().get(BaseFacetKey.ALT_4_NAME);
}
default String getAlt4Wiki() {
return (String)getFacetStore().get(BaseFacetKey.ALT_4_WIKI);
}
}

View file

@ -0,0 +1,13 @@
package love.distributedrebirth.numberxd.base2t.facet;
/**
*
*
* @author willemtsade ©Δ 仙上主天
*/
public interface BasePartShiftBits extends BasePart {
default Integer getShiftBits() {
return (Integer)getFacetStore().get(BaseFacetKey.SHIFT_BITS);
}
}

View file

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

View file

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

View file

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

View file

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

View file

@ -0,0 +1,73 @@
package love.distributedrebirth.numberxd;
import love.distributedrebirth.numberxd.base2t.BaseNumberTyte;
import love.distributedrebirth.numberxd.base2t.T08PartOctalBaseAppender;
import love.distributedrebirth.numberxd.base2t.T08PartOctalBaseIterator;
import love.distributedrebirth.numberxd.base2t.V009TyteBaseAppender;
/**
* Array of ŌṁKlompGetậl4ˢᴰ sliced as cheese.
*
* @author willemtsade ©Δ 仙上主天
*/
public class ŌṁKaassGetậl4ˢᴰ implements BaseNumberTyte<ŌṁKaassGetậl4ˢᴰ> {
private ŌṁKlompGetậl4ˢᴰ[] kaas;
private final int kaasCuts;
public ŌṁKaassGetậl4ˢᴰ(int kaasCuts) {
this.kaasCuts = kaasCuts;
this.kaas = new ŌṁKlompGetậl4ˢᴰ[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ậl4ˢᴰ getValue(int part) {
return kaas[validatePartRequest(part)];
}
public final void setValue(int part, ŌṁKlompGetậl4ˢᴰ value) {
kaas[validatePartRequest(part)] = value;
}
@Override
public final ŌṁKaassGetậl4ˢᴰ toClone() {
ŌṁKaassGetậl4ˢᴰ result = new ŌṁKaassGetậl4ˢᴰ(getKaasCuts());
T08PartOctalBaseIterator clonedOctals = iteratorOctalsByClone();
for (int i=0;i<getKaasCuts();i++) {
result.setValue(i, new ŌṁKlompGetậl4ˢᴰ(clonedOctals));
}
return result;
}
@Override
public final int getBitCount() {
return ŌṁKlompGetậl4ˢᴰ.BIT_COUNT * kaasCuts;
}
@Override
public final void fillOctalsByClone(T08PartOctalBaseAppender appender) {
for (ŌṁKlompGetậl4ˢᴰ value:kaas) {
value.fillOctalsByClone(appender);
}
}
@Override
public void fillTytesByReference(V009TyteBaseAppender appender) {
for (ŌṁKlompGetậl4ˢᴰ value:kaas) {
value.fillTytesByReference(appender);
}
}
}

View file

@ -0,0 +1,63 @@
package love.distributedrebirth.numberxd;
import love.distributedrebirth.numberxd.base2t.BaseNumberTyte;
import love.distributedrebirth.numberxd.base2t.T08PartOctal;
import love.distributedrebirth.numberxd.base2t.T08PartOctalBaseAppender;
import love.distributedrebirth.numberxd.base2t.T08PartOctalBaseIterator;
import love.distributedrebirth.numberxd.base2t.V009TyteBaseAppender;
import love.distributedrebirth.numberxd.base2t.V654Triz;
import love.distributedrebirth.numberxd.base2t.VCA8Tath;
/**
* Holds an 25920 bit value. (3240 bytes)
*
* 4 * VCA8Tath red
* 4 * VCA8Tath blue
*
* @author willemtsade ©Δ 仙上主天
*/
public class ŌṁKlompGetậl4ˢᴰ implements BaseNumberTyte<ŌṁKlompGetậl4ˢᴰ> {
public static int BIT_COUNT = V654Triz.BIT_COUNT * T08PartOctal.LENGTH;
private final VCA8Tath[] values = new VCA8Tath[T08PartOctal.LENGTH];
public ŌṁKlompGetậl4ˢᴰ() {
for (int i=0;i<T08PartOctal.LENGTH;i++) {
this.values[i] = new VCA8Tath();
}
}
public ŌṁKlompGetậl4ˢᴰ(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ậl4ˢᴰ toClone() {
return new ŌṁKlompGetậl4ˢᴰ(iteratorOctalsByClone());
}
@Override
public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T08PartOctal.forEach(v -> getValue(v).fillOctalsByClone(appender));
}
@Override
public void fillTytesByReference(V009TyteBaseAppender appender) {
T08PartOctal.forEach(v -> getValue(v).fillTytesByReference(appender));
}
}

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<modules version="1.0"
xmlns="http://language.x4o.org/xml/ns/modules"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://language.x4o.org/xml/ns/modules http://language.x4o.org/xml/ns/modules-1.0.xsd"
>
<language version="1.0">
<eld-resource>numberxd-lang.eld</eld-resource>
<eld-resource>numberxd-base2t.eld</eld-resource>
</language>
</modules>

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<drivers version="1.0"
xmlns="http://language.x4o.org/xml/ns/drivers"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://language.x4o.org/xml/ns/drivers http://language.x4o.org/xml/ns/drivers-1.0.xsd"
>
<defaultDriver language="numberxd"/>
</drivers>

View file

@ -0,0 +1,34 @@
package love.distributedrebirth.numberxd.base2t;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
/**
*
*
* @author willemtsade ©Δ 仙上主天
*/
public class T02PartBinaryTest {
@Test
public void testBasePart() {
for (T02PartBinary value:T02PartBinary.values()) {
Assertions.assertNotNull(value.getIdentifierTone());
Assertions.assertNotNull(value.getIdentifierLetter());
Assertions.assertNotNull(value.getChinaKey());
Assertions.assertNotNull(value.getChinaValue());
}
}
@Test
public void testToneMap() {
Assertions.assertEquals(T02PartBinary.PART_1, T02PartBinary.valueOfTone("˧"));
Assertions.assertEquals(T02PartBinary.PART_2, T02PartBinary.valueOfTone(""));
}
@Test
public void testChinaMap() {
Assertions.assertEquals(T02PartBinary.PART_1, T02PartBinary.valueOfChina(""));
Assertions.assertEquals(T02PartBinary.PART_2, T02PartBinary.valueOfChina(""));
}
}

View file

@ -0,0 +1,36 @@
package love.distributedrebirth.numberxd.base2t;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
/**
*
*
* @author willemtsade ©Δ 仙上主天
*/
public class T03PartTritTest {
@Test
public void testBasePart() {
for (T03PartTrit value:T03PartTrit.values()) {
Assertions.assertNotNull(value.getIdentifierTone());
Assertions.assertNotNull(value.getIdentifierLetter());
Assertions.assertNotNull(value.getChinaKey());
Assertions.assertNotNull(value.getChinaValue());
}
}
@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("˨"));
}
@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(""));
}
}

View file

@ -0,0 +1,41 @@
package love.distributedrebirth.numberxd.base2t;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
/**
*
*
* @author willemtsade ©Δ 仙上主天
*/
public class T04PartQuadTest {
@Test
public void testBasePart() {
for (T04PartQuad value:T04PartQuad.values()) {
Assertions.assertNotNull(value.getIdentifierTone());
Assertions.assertNotNull(value.getIdentifierLetter());
Assertions.assertNotNull(value.getChinaKey());
Assertions.assertNotNull(value.getChinaValue());
Assertions.assertNotNull(value.getAlt1Value());
Assertions.assertNotNull(value.getAlt1Name());
Assertions.assertNotNull(value.getAlt1Wiki());
}
}
@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("˩"));
}
@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(""));
}
}

View file

@ -0,0 +1,40 @@
package love.distributedrebirth.numberxd.base2t;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
/**
*
*
* @author willemtsade ©Δ 仙上主天
*/
public class T05PartPentalTest {
@Test
public void testBasePart() {
for (T05PartPental value:T05PartPental.values()) {
Assertions.assertNotNull(value.getIdentifierTone());
Assertions.assertNotNull(value.getIdentifierLetter());
Assertions.assertNotNull(value.getChinaKey());
Assertions.assertNotNull(value.getChinaValue());
}
}
@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("˩"));
}
@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(""));
}
}

View file

@ -0,0 +1,41 @@
package love.distributedrebirth.numberxd.base2t;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
/**
*
*
* @author willemtsade ©Δ 仙上主天
*/
public class T06PartSeximalTest {
@Test
public void testBasePart() {
for (T06PartSeximal value:T06PartSeximal.values()) {
Assertions.assertNotNull(value.getIdentifierTone());
Assertions.assertNotNull(value.getIdentifierLetter());
Assertions.assertNotNull(value.getChinaKey());
Assertions.assertNotNull(value.getChinaValue());
Assertions.assertNotNull(value.getAlt1Value());
Assertions.assertNotNull(value.getAlt1Name());
Assertions.assertNotNull(value.getAlt1Wiki());
}
}
@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(""));
}
@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(""));
}
}

View file

@ -0,0 +1,44 @@
package love.distributedrebirth.numberxd.base2t;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
/**
*
*
* @author willemtsade ©Δ 仙上主天
*/
public class T08PartOctalTest {
@Test
public void testBasePart() {
for (T08PartOctal value:T08PartOctal.values()) {
Assertions.assertNotNull(value.getIdentifierTone());
Assertions.assertNotNull(value.getIdentifierLetter());
Assertions.assertNotNull(value.getChinaKey());
Assertions.assertNotNull(value.getChinaValue());
Assertions.assertNotNull(value.getAlt1Value());
Assertions.assertNotNull(value.getAlt1Name());
Assertions.assertNotNull(value.getAlt1Wiki());
Assertions.assertNotNull(value.getAlt2Value());
Assertions.assertNotNull(value.getAlt2Name());
Assertions.assertNotNull(value.getAlt2Wiki());
}
}
@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(""));
}
@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(""));
}
}

View file

@ -0,0 +1,41 @@
package love.distributedrebirth.numberxd.base2t;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
/**
*
*
* @author willemtsade ©Δ 仙上主天
*/
public class T12PartUncialTest {
@Test
public void testBasePart() {
for (T12PartUncial value:T12PartUncial.values()) {
Assertions.assertNotNull(value.getIdentifierTone());
Assertions.assertNotNull(value.getIdentifierLetter());
Assertions.assertNotNull(value.getChinaKey());
Assertions.assertNotNull(value.getChinaValue());
Assertions.assertNotNull(value.getAlt1Value());
Assertions.assertNotNull(value.getAlt1Name());
Assertions.assertNotNull(value.getAlt1Wiki());
}
}
@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(""));
}
@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(""));
}
}

View file

@ -0,0 +1,41 @@
package love.distributedrebirth.numberxd.base2t;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
/**
*
*
* @author willemtsade ©Δ 仙上主天
*/
public class T16PartHexTest {
@Test
public void testBasePart() {
for (T16PartHex value:T16PartHex.values()) {
Assertions.assertNotNull(value.getIdentifierTone());
Assertions.assertNotNull(value.getIdentifierLetter());
Assertions.assertNotNull(value.getChinaKey());
Assertions.assertNotNull(value.getChinaValue());
Assertions.assertNotNull(value.getAlt1Value());
Assertions.assertNotNull(value.getAlt1Name());
Assertions.assertNotNull(value.getAlt1Wiki());
}
}
@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(""));
}
@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(""));
}
}

View file

@ -0,0 +1,41 @@
package love.distributedrebirth.numberxd.base2t;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
/**
*
*
* @author willemtsade ©Δ 仙上主天
*/
public class T20PartScoreTest {
@Test
public void testBasePart() {
for (T20PartScore value:T20PartScore.values()) {
Assertions.assertNotNull(value.getIdentifierTone());
Assertions.assertNotNull(value.getIdentifierLetter());
Assertions.assertNotNull(value.getChinaKey());
Assertions.assertNotNull(value.getChinaValue());
Assertions.assertNotNull(value.getAlt1Value());
Assertions.assertNotNull(value.getAlt1Name());
Assertions.assertNotNull(value.getAlt1Wiki());
}
}
@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(""));
}
@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(""));
}
}

View file

@ -0,0 +1,38 @@
package love.distributedrebirth.numberxd.base2t;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
/**
*
*
* @author willemtsade ©Δ 仙上主天
*/
public class T60SexagesimalTest {
@Test
public void testBasePart() {
for (T60Sexagesimal value:T60Sexagesimal.values()) {
Assertions.assertNotNull(value.getIdentifierTone());
Assertions.assertNotNull(value.getIdentifierLetter());
Assertions.assertNotNull(value.getChinaKey());
Assertions.assertNotNull(value.getChinaValue());
}
}
@Test
public void testToneMap() {
Assertions.assertEquals(T60Sexagesimal.PART_1, T60Sexagesimal.valueOfTone("˧˩˥"));
Assertions.assertEquals(T60Sexagesimal.PART_2, T60Sexagesimal.valueOfTone("˧˥˦"));
Assertions.assertEquals(T60Sexagesimal.PART_59, T60Sexagesimal.valueOfTone("꜍꜍꜏"));
Assertions.assertEquals(T60Sexagesimal.PART_60, T60Sexagesimal.valueOfTone("꜑꜑꜏"));
}
@Test
public void testChinaMap() {
Assertions.assertEquals(T60Sexagesimal.PART_1, T60Sexagesimal.valueOfChina(""));
Assertions.assertEquals(T60Sexagesimal.PART_2, T60Sexagesimal.valueOfChina(""));
Assertions.assertEquals(T60Sexagesimal.PART_59, T60Sexagesimal.valueOfChina(""));
Assertions.assertEquals(T60Sexagesimal.PART_60, T60Sexagesimal.valueOfChina(""));
}
}