2022-01-30 22:00:16 +01:00
|
|
|
package love.distributedrebirth.numberxd.base2t;
|
2022-01-28 11:19:52 +01:00
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
2022-02-02 18:26:21 +01:00
|
|
|
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
|
2022-02-02 22:51:56 +01:00
|
|
|
import love.distributedrebirth.numberxd.base2t.part.T08PartOctal;
|
2022-02-02 18:26:21 +01:00
|
|
|
|
2022-01-29 05:50:02 +01:00
|
|
|
/**
|
2022-01-31 13:40:01 +01:00
|
|
|
* Octal base based number interface.
|
2022-01-29 05:50:02 +01:00
|
|
|
*/
|
2022-02-02 18:26:21 +01:00
|
|
|
@BãßBȍőnAuthorInfoʸᴰ(name = "willemtsade", copyright = "©Δ∞ 仙上主天")
|
2022-01-28 11:19:52 +01:00
|
|
|
public interface BaseNumber<V extends BaseNumber<V>> {
|
|
|
|
|
|
2022-01-31 13:15:04 +01:00
|
|
|
static float CIRCLE_DEGREE = 360f;
|
|
|
|
|
|
2022-01-28 18:37:50 +01:00
|
|
|
int getBitCount();
|
|
|
|
|
|
2022-01-31 13:15:04 +01:00
|
|
|
default float getSliceAngle() {
|
|
|
|
|
return CIRCLE_DEGREE/getBitCount();
|
2022-01-28 18:37:50 +01:00
|
|
|
}
|
|
|
|
|
|
2022-01-28 11:19:52 +01:00
|
|
|
V toClone();
|
|
|
|
|
|
2022-02-02 18:26:21 +01:00
|
|
|
void fillOctalsByClone(BaseAppenderOctal appender);
|
2022-01-28 11:19:52 +01:00
|
|
|
|
2022-02-02 18:26:21 +01:00
|
|
|
default BaseIteratorOctal iteratorOctalsByClone() {
|
2022-01-28 11:19:52 +01:00
|
|
|
List<T08PartOctal> octals = new ArrayList<>();
|
2022-02-02 18:26:21 +01:00
|
|
|
fillOctalsByClone(new BaseAppenderOctal(octals));
|
2022-02-04 18:00:03 +01:00
|
|
|
return new BaseIteratorOctalAdapter(octals.iterator());
|
2022-01-28 11:19:52 +01:00
|
|
|
}
|
|
|
|
|
}
|