Moved numberxd to libary and added some unit tests.
This commit is contained in:
parent
af627bbd06
commit
444ced9ee2
70 changed files with 427 additions and 6 deletions
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue