Added bit count and angle.

This commit is contained in:
Willem Cazander 2022-01-28 18:37:50 +01:00
parent 6cb6ba8c11
commit 0e059dc80a
10 changed files with 49 additions and 2 deletions

View file

@ -5,6 +5,12 @@ import java.util.List;
public interface BaseNumber<V extends BaseNumber<V>> {
int getBitCount();
default int getSliceAngle() {
return 360/getBitCount();
}
V toClone();
void fillOctalValues(T08PartOctalBaseAppender appender);

View file

@ -15,6 +15,7 @@ public enum T08PartOctal implements BasePartIdentifierAlt, BasePartIdentifierTon
;
public static int LENGTH = 8;
public static int BIT_COUNT = 3;
private static final byte BITMASK = 0x07;
private final String identifier;
private final String identifierAlt; // absolute

View file

@ -24,6 +24,11 @@ public final class V003Timble implements BaseNumber<V003Timble> {
return value;
}
@Override
public int getBitCount() {
return T08PartOctal.BIT_COUNT;
}
@Override
public V003Timble toClone() {
return new V003Timble(getValue());

View file

@ -24,12 +24,17 @@ public final class V006Tixte implements BaseNumber<V006Tixte> {
public void setValue(T02PartBinary part, V003Timble value) {
values[part.ordinal()] = value;
}
@Override
public int getBitCount() {
return T08PartOctal.BIT_COUNT * T02PartBinary.LENGTH;
}
@Override
public V006Tixte toClone() {
return new V006Tixte(cloneIterator());
}
@Override
public void fillOctalValues(T08PartOctalBaseAppender appender) {
T02PartBinary.forEach(v -> getValue(v).fillOctalValues(appender));

View file

@ -30,6 +30,11 @@ public final class V009Tyte implements BaseNumberTyte<V009Tyte> {
values[part.ordinal()] = value;
}
@Override
public int getBitCount() {
return T08PartOctal.BIT_COUNT * T03PartTrit.LENGTH;
}
@Override
public V009Tyte toClone() {
return new V009Tyte(cloneIterator());

View file

@ -37,6 +37,11 @@ public final class V018Tord implements BaseNumberTyte<V018Tord> {
getValue(part.splitPartBinary()).setValue(part.splitPartTrit(), value);;
}
@Override
public int getBitCount() {
return T08PartOctal.BIT_COUNT * T06PartSeximal.LENGTH;
}
@Override
public V018Tord toClone() {
return new V018Tord(cloneIterator());

View file

@ -30,6 +30,11 @@ public final class V027Temvig implements BaseNumberTyte<V027Temvig> {
values[part.ordinal()] = value;
}
@Override
public int getBitCount() {
return T08PartOctal.BIT_COUNT * T03PartTrit.LENGTH * T03PartTrit.LENGTH;
}
@Override
public V027Temvig toClone() {
return new V027Temvig(cloneIterator());

View file

@ -39,6 +39,11 @@ public final class V036Teger implements BaseNumberTyte<V036Teger> {
.setValue(part.splitPartBinary(T02PartBinary.PART_2), value);
}
@Override
public int getBitCount() {
return T08PartOctal.BIT_COUNT * T12PartUncial.LENGTH;
}
@Override
public V036Teger toClone() {
return new V036Teger(cloneIterator());

View file

@ -29,6 +29,11 @@ public final class V072Tong implements BaseNumberTyte<V072Tong> {
values[part.ordinal()] = value;
}
@Override
public int getBitCount() {
return T08PartOctal.BIT_COUNT * T12PartUncial.LENGTH * T02PartBinary.LENGTH;
}
@Override
public V072Tong toClone() {
return new V072Tong(cloneIterator());

View file

@ -55,6 +55,11 @@ public final class V144Tocta implements BaseNumberTyte<V144Tocta> {
.setValue(part.splitPartBinary(T03PartTrit.PART_3), value);
}
@Override
public int getBitCount() {
return T08PartOctal.BIT_COUNT * T12PartUncial.LENGTH * T04PartQuad.LENGTH;
}
@Override
public V144Tocta toClone() {
return new V144Tocta(cloneIterator());