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

View file

@ -51,16 +51,16 @@ public class GroßGetậl6D implements BaseNumberTyte<GroßGetậl6D> {
@Override
public GroßGetậl6D toClone() {
return new GroßGetậl6D(cloneIterator());
return new GroßGetậl6D(iteratorOctalsByClone());
}
@Override
public void fillOctalValues(T08PartOctalBaseAppender appender) {
T12PartUncial.forEach(v -> getValue(v).fillOctalValues(appender));
public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T12PartUncial.forEach(v -> getValue(v).fillOctalsByClone(appender));
}
@Override
public void fillTyteValues(V009TyteBaseAppender appender) {
T12PartUncial.forEach(v -> getValue(v).fillTyteValues(appender));
public void fillTytesByReference(V009TyteBaseAppender 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
public final V toClone() {
V result = toCloneFractal(getFractalLevel());
T08PartOctalBaseIterator clonedOctals = cloneIterator();
T08PartOctalBaseIterator clonedOctals = iteratorOctalsByClone();
for (int i=0;i<getValuesLength();i++) {
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
public final void fillOctalValues(T08PartOctalBaseAppender appender) {
public final void fillOctalsByClone(T08PartOctalBaseAppender appender) {
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
public final V toClone() {
V result = toCloneFractal(getFractalLevel());
T08PartOctalBaseIterator clonedOctals = cloneIterator();
T08PartOctalBaseIterator clonedOctals = iteratorOctalsByClone();
for (int i=0;i<getValuesLength();i++) {
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
public final void fillOctalValues(T08PartOctalBaseAppender appender) {
public final void fillOctalsByClone(T08PartOctalBaseAppender appender) {
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
List<T08PartOctal> octals = new ArrayList<>();
T08PartOctalBaseAppender appender = new T08PartOctalBaseAppender(octals);
data.forEach(v -> v.fillOctalValues(appender));
data.forEach(v -> v.fillOctalsByClone(appender));
Iterator<T08PartOctal> read = octals.iterator();
while (read.hasNext()) {
int byteTriplet = 0;

View file

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

View file

@ -1,5 +1,8 @@
package love.distributedrebirth.numberxd.base2t;
import java.util.ArrayList;
import java.util.List;
/**
*
* @author willemtsade ©Δ 仙上主天
@ -7,5 +10,11 @@ package love.distributedrebirth.numberxd.base2t;
*/
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 static int BIT_COUNT = T08PartOctal.BIT_COUNT;
private T08PartOctal value;
private final T08PartOctal value;
public V003Timble() {
this(T08PartOctal.PART_1);
@ -20,10 +20,6 @@ public final class V003Timble implements BaseNumber<V003Timble> {
}
public V003Timble(T08PartOctal value) {
setValue(value);
}
public void setValue(T08PartOctal value) {
this.value = value;
}
@ -42,7 +38,7 @@ public final class V003Timble implements BaseNumber<V003Timble> {
}
@Override
public void fillOctalValues(T08PartOctalBaseAppender appender) {
public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
appender.add(getValue());
}
}

View file

@ -38,11 +38,11 @@ public final class V006Tixte implements BaseNumber<V006Tixte> {
@Override
public V006Tixte toClone() {
return new V006Tixte(cloneIterator());
return new V006Tixte(iteratorOctalsByClone());
}
@Override
public void fillOctalValues(T08PartOctalBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillOctalValues(appender));
public void fillOctalsByClone(T08PartOctalBaseAppender 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 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() {
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) {
setValue(T03PartTrit.PART_1, valueHigh);
setValue(T03PartTrit.PART_2, valueMedium);
setValue(T03PartTrit.PART_3, 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()];
}
public void setValue(T03PartTrit part, V003Timble value) {
values[part.ordinal()] = value;
}
@Override
public int getBitCount() {
return BIT_COUNT;
@ -44,16 +40,16 @@ public final class V009Tyte implements BaseNumberTyte<V009Tyte> {
@Override
public V009Tyte toClone() {
return new V009Tyte(cloneIterator());
return new V009Tyte(iteratorOctalsByClone());
}
@Override
public void fillOctalValues(T08PartOctalBaseAppender appender) {
T03PartTrit.forEach(v -> getValue(v).fillOctalValues(appender));
public void fillOctalsByClone(T08PartOctalBaseAppender appender) {
T03PartTrit.forEach(v -> getValue(v).fillOctalsByClone(appender));
}
@Override
public void fillTyteValues(V009TyteBaseAppender appender) {
public void fillTytesByReference(V009TyteBaseAppender appender) {
appender.add(this);
}
}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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