Renames iterators to proper names

This commit is contained in:
Willem Cazander 2022-01-31 13:15:04 +01:00
parent 87e11528d7
commit c50444e04c
19 changed files with 99 additions and 96 deletions

View file

@ -54,7 +54,7 @@ public class GroßGetậl1D implements BaseNumberTyte<GroßGetậl1D> {
public GroßGetậl1D(V090Tocta tocta) { public GroßGetậl1D(V090Tocta tocta) {
List<V009Tyte> tytes = new ArrayList<>(); List<V009Tyte> tytes = new ArrayList<>();
tocta.fillTyteValues(new V009TyteBaseAppender(tytes)); tocta.fillTytesByReference(new V009TyteBaseAppender(tytes));
for (int i=0;i<NUMERATOR_SIZE;i++) { for (int i=0;i<NUMERATOR_SIZE;i++) {
numerator[i] = tytes.get(i); numerator[i] = tytes.get(i);
} }
@ -63,8 +63,12 @@ public class GroßGetậl1D implements BaseNumberTyte<GroßGetậl1D> {
} }
} }
public V090Tocta toTocta() { public V090Tocta toToctaByReference() {
return new V090Tocta(cloneIterator()); return new V090Tocta(iteratorTytesByReference());
}
public V090Tocta toToctaByClone() {
return new V090Tocta(iteratorOctalsByClone());
} }
@Override @Override
@ -74,21 +78,21 @@ public class GroßGetậl1D implements BaseNumberTyte<GroßGetậl1D> {
@Override @Override
public GroßGetậl1D toClone() { public GroßGetậl1D toClone() {
return new GroßGetậl1D(cloneIterator()); return new GroßGetậl1D(iteratorOctalsByClone());
} }
@Override @Override
public void fillOctalValues(T08PartOctalBaseAppender appender) { public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
for (int i=0;i<NUMERATOR_SIZE;i++) { for (int i=0;i<NUMERATOR_SIZE;i++) {
numerator[i].fillOctalValues(appender); numerator[i].fillOctalsByClone(appender);
} }
for (int i=0;i<DENOMINATOR_SIZE;i++) { for (int i=0;i<DENOMINATOR_SIZE;i++) {
denominator[i].fillOctalValues(appender); denominator[i].fillOctalsByClone(appender);
} }
} }
@Override @Override
public void fillTyteValues(V009TyteBaseAppender appender) { public void fillTytesByReference(V009TyteBaseAppender appender) {
for (int i=0;i<NUMERATOR_SIZE;i++) { for (int i=0;i<NUMERATOR_SIZE;i++) {
appender.add(numerator[i]); appender.add(numerator[i]);
} }

View file

@ -51,16 +51,16 @@ public class GroßGetậl6D implements BaseNumberTyte<GroßGetậl6D> {
@Override @Override
public GroßGetậl6D toClone() { public GroßGetậl6D toClone() {
return new GroßGetậl6D(cloneIterator()); return new GroßGetậl6D(iteratorOctalsByClone());
} }
@Override @Override
public void fillOctalValues(T08PartOctalBaseAppender appender) { public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T12PartUncial.forEach(v -> getValue(v).fillOctalValues(appender)); T12PartUncial.forEach(v -> getValue(v).fillOctalsByClone(appender));
} }
@Override @Override
public void fillTyteValues(V009TyteBaseAppender appender) { public void fillTytesByReference(V009TyteBaseAppender appender) {
T12PartUncial.forEach(v -> getValue(v).fillTyteValues(appender)); T12PartUncial.forEach(v -> getValue(v).fillTytesByReference(appender));
} }
} }

View file

@ -49,7 +49,7 @@ abstract public class GroßGetậlŌṁ1D<V extends GroßGetậlŌṁ1D<V> & Bas
@Override @Override
public final V toClone() { public final V toClone() {
V result = toCloneFractal(getFractalLevel()); V result = toCloneFractal(getFractalLevel());
T08PartOctalBaseIterator clonedOctals = cloneIterator(); T08PartOctalBaseIterator clonedOctals = iteratorOctalsByClone();
for (int i=0;i<getValuesLength();i++) { for (int i=0;i<getValuesLength();i++) {
result.setValue(i, new GroßGetậl1D(clonedOctals)); result.setValue(i, new GroßGetậl1D(clonedOctals));
} }
@ -62,9 +62,9 @@ abstract public class GroßGetậlŌṁ1D<V extends GroßGetậlŌṁ1D<V> & Bas
} }
@Override @Override
public final void fillOctalValues(T08PartOctalBaseAppender appender) { public final void fillOctalsByClone(T08PartOctalBaseAppender appender) {
for (GroßGetậl1D value:values) { for (GroßGetậl1D value:values) {
value.fillOctalValues(appender); value.fillOctalsByClone(appender);
} }
} }
} }

View file

@ -49,7 +49,7 @@ abstract public class GroßGetậlŌṁ6D<V extends GroßGetậlŌṁ6D<V> & Bas
@Override @Override
public final V toClone() { public final V toClone() {
V result = toCloneFractal(getFractalLevel()); V result = toCloneFractal(getFractalLevel());
T08PartOctalBaseIterator clonedOctals = cloneIterator(); T08PartOctalBaseIterator clonedOctals = iteratorOctalsByClone();
for (int i=0;i<getValuesLength();i++) { for (int i=0;i<getValuesLength();i++) {
result.setValue(i, new GroßGetậl6D(clonedOctals)); result.setValue(i, new GroßGetậl6D(clonedOctals));
} }
@ -62,9 +62,9 @@ abstract public class GroßGetậlŌṁ6D<V extends GroßGetậlŌṁ6D<V> & Bas
} }
@Override @Override
public final void fillOctalValues(T08PartOctalBaseAppender appender) { public final void fillOctalsByClone(T08PartOctalBaseAppender appender) {
for (GroßGetậl6D value:values) { for (GroßGetậl6D value:values) {
value.fillOctalValues(appender); value.fillOctalsByClone(appender);
} }
} }
} }

View file

@ -80,7 +80,7 @@ public class Base2Terminator {
int totalBytes = 0; // per 8 octa's is 3 bytes int totalBytes = 0; // per 8 octa's is 3 bytes
List<T08PartOctal> octals = new ArrayList<>(); List<T08PartOctal> octals = new ArrayList<>();
T08PartOctalBaseAppender appender = new T08PartOctalBaseAppender(octals); T08PartOctalBaseAppender appender = new T08PartOctalBaseAppender(octals);
data.forEach(v -> v.fillOctalValues(appender)); data.forEach(v -> v.fillOctalsByClone(appender));
Iterator<T08PartOctal> read = octals.iterator(); Iterator<T08PartOctal> read = octals.iterator();
while (read.hasNext()) { while (read.hasNext()) {
int byteTriplet = 0; int byteTriplet = 0;

View file

@ -10,19 +10,21 @@ import java.util.List;
*/ */
public interface BaseNumber<V extends BaseNumber<V>> { public interface BaseNumber<V extends BaseNumber<V>> {
static float CIRCLE_DEGREE = 360f;
int getBitCount(); int getBitCount();
default int getSliceAngle() { default float getSliceAngle() {
return 360/getBitCount(); return CIRCLE_DEGREE/getBitCount();
} }
V toClone(); V toClone();
void fillOctalValues(T08PartOctalBaseAppender appender); void fillOctalsByClone(T08PartOctalBaseAppender appender);
default T08PartOctalBaseIterator cloneIterator() { default T08PartOctalBaseIterator iteratorOctalsByClone() {
List<T08PartOctal> octals = new ArrayList<>(); List<T08PartOctal> octals = new ArrayList<>();
fillOctalValues(new T08PartOctalBaseAppender(octals)); fillOctalsByClone(new T08PartOctalBaseAppender(octals));
return new T08PartOctalBaseIterator(octals.iterator()); return new T08PartOctalBaseIterator(octals.iterator());
} }
} }

View file

@ -1,5 +1,8 @@
package love.distributedrebirth.numberxd.base2t; package love.distributedrebirth.numberxd.base2t;
import java.util.ArrayList;
import java.util.List;
/** /**
* *
* @author willemtsade ©Δ 仙上主天 * @author willemtsade ©Δ 仙上主天
@ -7,5 +10,11 @@ package love.distributedrebirth.numberxd.base2t;
*/ */
public interface BaseNumberTyte<V extends BaseNumber<V>> extends BaseNumber<V> { public interface BaseNumberTyte<V extends BaseNumber<V>> extends BaseNumber<V> {
void fillTyteValues(V009TyteBaseAppender appender); void fillTytesByReference(V009TyteBaseAppender appender);
default V009TyteBaseIterator iteratorTytesByReference() {
List<V009Tyte> tytes = new ArrayList<>();
fillTytesByReference(new V009TyteBaseAppender(tytes));
return new V009TyteBaseIterator(tytes.iterator());
}
} }

View file

@ -9,7 +9,7 @@ package love.distributedrebirth.numberxd.base2t;
public final class V003Timble implements BaseNumber<V003Timble> { public final class V003Timble implements BaseNumber<V003Timble> {
public static int BIT_COUNT = T08PartOctal.BIT_COUNT; public static int BIT_COUNT = T08PartOctal.BIT_COUNT;
private T08PartOctal value; private final T08PartOctal value;
public V003Timble() { public V003Timble() {
this(T08PartOctal.PART_1); this(T08PartOctal.PART_1);
@ -20,10 +20,6 @@ public final class V003Timble implements BaseNumber<V003Timble> {
} }
public V003Timble(T08PartOctal value) { public V003Timble(T08PartOctal value) {
setValue(value);
}
public void setValue(T08PartOctal value) {
this.value = value; this.value = value;
} }
@ -42,7 +38,7 @@ public final class V003Timble implements BaseNumber<V003Timble> {
} }
@Override @Override
public void fillOctalValues(T08PartOctalBaseAppender appender) { public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
appender.add(getValue()); appender.add(getValue());
} }
} }

View file

@ -38,11 +38,11 @@ public final class V006Tixte implements BaseNumber<V006Tixte> {
@Override @Override
public V006Tixte toClone() { public V006Tixte toClone() {
return new V006Tixte(cloneIterator()); return new V006Tixte(iteratorOctalsByClone());
} }
@Override @Override
public void fillOctalValues(T08PartOctalBaseAppender appender) { public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillOctalValues(appender)); T02PartBinary.forEach(v -> getValue(v).fillOctalsByClone(appender));
} }
} }

View file

@ -9,7 +9,7 @@ package love.distributedrebirth.numberxd.base2t;
public final class V009Tyte implements BaseNumberTyte<V009Tyte> { public final class V009Tyte implements BaseNumberTyte<V009Tyte> {
public static int BIT_COUNT = V003Timble.BIT_COUNT * T03PartTrit.LENGTH; public static int BIT_COUNT = V003Timble.BIT_COUNT * T03PartTrit.LENGTH;
private V003Timble[] values = new V003Timble[T03PartTrit.LENGTH]; private final V003Timble[] values = new V003Timble[T03PartTrit.LENGTH];
public V009Tyte() { public V009Tyte() {
this(new V003Timble(), new V003Timble(), new V003Timble()); this(new V003Timble(), new V003Timble(), new V003Timble());
@ -24,19 +24,15 @@ public final class V009Tyte implements BaseNumberTyte<V009Tyte> {
} }
private V009Tyte(V003Timble valueHigh, V003Timble valueMedium, V003Timble valueLow) { private V009Tyte(V003Timble valueHigh, V003Timble valueMedium, V003Timble valueLow) {
setValue(T03PartTrit.PART_1, valueHigh); values[T03PartTrit.PART_1.ordinal()] = valueHigh;
setValue(T03PartTrit.PART_2, valueMedium); values[T03PartTrit.PART_2.ordinal()] = valueMedium;
setValue(T03PartTrit.PART_3, valueLow); values[T03PartTrit.PART_3.ordinal()] = valueLow;
} }
public V003Timble getValue(T03PartTrit part) { public V003Timble getValue(T03PartTrit part) {
return values[part.ordinal()]; return values[part.ordinal()];
} }
public void setValue(T03PartTrit part, V003Timble value) {
values[part.ordinal()] = value;
}
@Override @Override
public int getBitCount() { public int getBitCount() {
return BIT_COUNT; return BIT_COUNT;
@ -44,16 +40,16 @@ public final class V009Tyte implements BaseNumberTyte<V009Tyte> {
@Override @Override
public V009Tyte toClone() { public V009Tyte toClone() {
return new V009Tyte(cloneIterator()); return new V009Tyte(iteratorOctalsByClone());
} }
@Override @Override
public void fillOctalValues(T08PartOctalBaseAppender appender) { public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T03PartTrit.forEach(v -> getValue(v).fillOctalValues(appender)); T03PartTrit.forEach(v -> getValue(v).fillOctalsByClone(appender));
} }
@Override @Override
public void fillTyteValues(V009TyteBaseAppender appender) { public void fillTytesByReference(V009TyteBaseAppender appender) {
appender.add(this); appender.add(this);
} }
} }

View file

@ -40,10 +40,6 @@ public final class V012Tord implements BaseNumberTyte<V012Tord> {
return getValue(part.splitPartBinary()).getValue(part.splitPartTrit()); return getValue(part.splitPartBinary()).getValue(part.splitPartTrit());
} }
public void setTimblePart(T06PartSeximal part, V003Timble value) {
getValue(part.splitPartBinary()).setValue(part.splitPartTrit(), value);;
}
@Override @Override
public int getBitCount() { public int getBitCount() {
return BIT_COUNT; return BIT_COUNT;
@ -51,16 +47,16 @@ public final class V012Tord implements BaseNumberTyte<V012Tord> {
@Override @Override
public V012Tord toClone() { public V012Tord toClone() {
return new V012Tord(cloneIterator()); return new V012Tord(iteratorOctalsByClone());
} }
@Override @Override
public void fillOctalValues(T08PartOctalBaseAppender appender) { public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillOctalValues(appender)); T02PartBinary.forEach(v -> getValue(v).fillOctalsByClone(appender));
} }
@Override @Override
public void fillTyteValues(V009TyteBaseAppender appender) { public void fillTytesByReference(V009TyteBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillTyteValues(appender)); T02PartBinary.forEach(v -> getValue(v).fillTytesByReference(appender));
} }
} }

View file

@ -44,16 +44,16 @@ public final class V01BTemvig implements BaseNumberTyte<V01BTemvig> {
@Override @Override
public V01BTemvig toClone() { public V01BTemvig toClone() {
return new V01BTemvig(cloneIterator()); return new V01BTemvig(iteratorOctalsByClone());
} }
@Override @Override
public void fillOctalValues(T08PartOctalBaseAppender appender) { public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T03PartTrit.forEach(v -> getValue(v).fillOctalValues(appender)); T03PartTrit.forEach(v -> getValue(v).fillOctalsByClone(appender));
} }
@Override @Override
public void fillTyteValues(V009TyteBaseAppender appender) { public void fillTytesByReference(V009TyteBaseAppender appender) {
T03PartTrit.forEach(v -> getValue(v).fillTyteValues(appender)); T03PartTrit.forEach(v -> getValue(v).fillTytesByReference(appender));
} }
} }

View file

@ -53,16 +53,16 @@ public final class V024Teger implements BaseNumberTyte<V024Teger> {
@Override @Override
public V024Teger toClone() { public V024Teger toClone() {
return new V024Teger(cloneIterator()); return new V024Teger(iteratorOctalsByClone());
} }
@Override @Override
public void fillOctalValues(T08PartOctalBaseAppender appender) { public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillOctalValues(appender)); T02PartBinary.forEach(v -> getValue(v).fillOctalsByClone(appender));
} }
@Override @Override
public void fillTyteValues(V009TyteBaseAppender appender) { public void fillTytesByReference(V009TyteBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillTyteValues(appender)); T02PartBinary.forEach(v -> getValue(v).fillTytesByReference(appender));
} }
} }

View file

@ -55,16 +55,16 @@ public final class V048Tong implements BaseNumberTyte<V048Tong> {
@Override @Override
public V048Tong toClone() { public V048Tong toClone() {
return new V048Tong(cloneIterator()); return new V048Tong(iteratorOctalsByClone());
} }
@Override @Override
public void fillOctalValues(T08PartOctalBaseAppender appender) { public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillOctalValues(appender)); T02PartBinary.forEach(v -> getValue(v).fillOctalsByClone(appender));
} }
@Override @Override
public void fillTyteValues(V009TyteBaseAppender appender) { public void fillTytesByReference(V009TyteBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillTyteValues(appender)); T02PartBinary.forEach(v -> getValue(v).fillTytesByReference(appender));
} }
} }

View file

@ -69,16 +69,16 @@ public final class V090Tocta implements BaseNumberTyte<V090Tocta> {
@Override @Override
public V090Tocta toClone() { public V090Tocta toClone() {
return new V090Tocta(cloneIterator()); return new V090Tocta(iteratorOctalsByClone());
} }
@Override @Override
public void fillOctalValues(T08PartOctalBaseAppender appender) { public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillOctalValues(appender)); T02PartBinary.forEach(v -> getValue(v).fillOctalsByClone(appender));
} }
@Override @Override
public void fillTyteValues(V009TyteBaseAppender appender) { public void fillTytesByReference(V009TyteBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillTyteValues(appender)); T02PartBinary.forEach(v -> getValue(v).fillTytesByReference(appender));
} }
} }

View file

@ -38,16 +38,16 @@ public class V654Triz implements BaseNumberTyte<V654Triz> {
@Override @Override
public V654Triz toClone() { public V654Triz toClone() {
return new V654Triz(cloneIterator()); return new V654Triz(iteratorOctalsByClone());
} }
@Override @Override
public void fillOctalValues(T08PartOctalBaseAppender appender) { public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T60Sexagesimal.forEach(v -> getValue(v).fillOctalValues(appender)); T60Sexagesimal.forEach(v -> getValue(v).fillOctalsByClone(appender));
} }
@Override @Override
public void fillTyteValues(V009TyteBaseAppender appender) { public void fillTytesByReference(V009TyteBaseAppender appender) {
T60Sexagesimal.forEach(v -> getValue(v).fillTyteValues(appender)); T60Sexagesimal.forEach(v -> getValue(v).fillTytesByReference(appender));
} }
} }

View file

@ -39,16 +39,16 @@ public class VCA8Tath implements BaseNumberTyte<VCA8Tath> {
@Override @Override
public VCA8Tath toClone() { public VCA8Tath toClone() {
return new VCA8Tath(cloneIterator()); return new VCA8Tath(iteratorOctalsByClone());
} }
@Override @Override
public void fillOctalValues(T08PartOctalBaseAppender appender) { public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillOctalValues(appender)); T02PartBinary.forEach(v -> getValue(v).fillOctalsByClone(appender));
} }
@Override @Override
public void fillTyteValues(V009TyteBaseAppender appender) { public void fillTytesByReference(V009TyteBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillTyteValues(appender)); T02PartBinary.forEach(v -> getValue(v).fillTytesByReference(appender));
} }
} }

View file

@ -46,7 +46,7 @@ public class ŌṁKaassGetậl4D implements BaseNumberTyte<ŌṁKaassGetậl4D>
@Override @Override
public final ŌṁKaassGetậl4D toClone() { public final ŌṁKaassGetậl4D toClone() {
ŌṁKaassGetậl4D result = new ŌṁKaassGetậl4D(getKaasCuts()); ŌṁKaassGetậl4D result = new ŌṁKaassGetậl4D(getKaasCuts());
T08PartOctalBaseIterator clonedOctals = cloneIterator(); T08PartOctalBaseIterator clonedOctals = iteratorOctalsByClone();
for (int i=0;i<getKaasCuts();i++) { for (int i=0;i<getKaasCuts();i++) {
result.setValue(i, new ŌṁKlompGetậl4D(clonedOctals)); result.setValue(i, new ŌṁKlompGetậl4D(clonedOctals));
} }
@ -59,16 +59,16 @@ public class ŌṁKaassGetậl4D implements BaseNumberTyte<ŌṁKaassGetậl4D>
} }
@Override @Override
public final void fillOctalValues(T08PartOctalBaseAppender appender) { public final void fillOctalsByClone(T08PartOctalBaseAppender appender) {
for (ŌṁKlompGetậl4D value:kaas) { for (ŌṁKlompGetậl4D value:kaas) {
value.fillOctalValues(appender); value.fillOctalsByClone(appender);
} }
} }
@Override @Override
public void fillTyteValues(V009TyteBaseAppender appender) { public void fillTytesByReference(V009TyteBaseAppender appender) {
for (ŌṁKlompGetậl4D value:kaas) { for (ŌṁKlompGetậl4D value:kaas) {
value.fillTyteValues(appender); value.fillTytesByReference(appender);
} }
} }
} }

View file

@ -49,16 +49,16 @@ public class ŌṁKlompGetậl4D implements BaseNumberTyte<ŌṁKlompGetậl4D>
@Override @Override
public ŌṁKlompGetậl4D toClone() { public ŌṁKlompGetậl4D toClone() {
return new ŌṁKlompGetậl4D(cloneIterator()); return new ŌṁKlompGetậl4D(iteratorOctalsByClone());
} }
@Override @Override
public void fillOctalValues(T08PartOctalBaseAppender appender) { public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T08PartOctal.forEach(v -> getValue(v).fillOctalValues(appender)); T08PartOctal.forEach(v -> getValue(v).fillOctalsByClone(appender));
} }
@Override @Override
public void fillTyteValues(V009TyteBaseAppender appender) { public void fillTytesByReference(V009TyteBaseAppender appender) {
T08PartOctal.forEach(v -> getValue(v).fillTyteValues(appender)); T08PartOctal.forEach(v -> getValue(v).fillTytesByReference(appender));
} }
} }