2022-10-30 23:14:53 +01:00
|
|
|
package ᴶᐩᐩ.ᒼᐤᒻᒻᓫᒼᐪᑊᐤᣕᔆ;
|
2022-10-23 03:04:55 +02:00
|
|
|
|
|
|
|
|
import java.util.PrimitiveIterator;
|
|
|
|
|
import java.util.function.Consumer;
|
|
|
|
|
|
2022-10-30 08:26:14 +01:00
|
|
|
import love.distributedrebirth.bassboon.Bãß;
|
2022-10-30 23:14:53 +01:00
|
|
|
import ᴶᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
|
|
|
|
|
import ᴶᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᔿᣔᐪᣗᑊᕁ.M02MatrixBinary;
|
|
|
|
|
import ᴶᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᣳᣝᐤᣜᣳ.ᔿᣔᐪᣗᑊᕁ.M04MatrixQuad;
|
2022-10-23 03:04:55 +02:00
|
|
|
|
2022-10-30 16:59:24 +01:00
|
|
|
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
2022-10-23 03:04:55 +02:00
|
|
|
public interface PrimitiveBooleanIterator extends PrimitiveIterator<Boolean,PrimitiveBooleanConsumer> {
|
|
|
|
|
|
|
|
|
|
boolean nextBoolean();
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
default Boolean next() {
|
|
|
|
|
return nextBoolean();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
default void forEachRemaining(Consumer<? super Boolean> action) {
|
|
|
|
|
while (hasNext()) {
|
|
|
|
|
action.accept(nextBoolean());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
default void forEachRemaining(PrimitiveBooleanConsumer action) {
|
|
|
|
|
while (hasNext()) {
|
|
|
|
|
action.accept(nextBoolean());
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-10-30 08:26:14 +01:00
|
|
|
|
|
|
|
|
default PrimitiveNibbleIterator toNibbleIteratorIndianBig() {
|
|
|
|
|
return toNibbleIterator(M04MatrixQuad.STATIC);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
default PrimitiveNibbleIterator toNibbleIteratorIndianLittle() {
|
|
|
|
|
return toNibbleIterator(M04MatrixQuad.TAIL);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
default PrimitiveNibbleIterator toNibbleIterator(M04MatrixQuad order) {
|
|
|
|
|
return new PrimitiveNibbleIterator() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean hasNext() {
|
|
|
|
|
return PrimitiveBooleanIterator.this.hasNext();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public byte nextNibble() {
|
|
|
|
|
int current = 0;
|
|
|
|
|
for (int i=0;i<4;i++) {
|
|
|
|
|
current += PrimitiveBooleanIterator.this.nextBoolean()?1:0 << order.rȧñkNummerBlokWaarde(i);
|
|
|
|
|
}
|
|
|
|
|
return (byte) current;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
default PrimitiveByteIterator toByteIterator(M02MatrixBinary order) {
|
|
|
|
|
if (M02MatrixBinary.TAIL.equals(order)) {
|
|
|
|
|
return toNibbleIterator(M04MatrixQuad.TAIL).toByteIterator(order);
|
|
|
|
|
}
|
|
|
|
|
return toNibbleIterator(M04MatrixQuad.STATIC).toByteIterator(order);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static PrimitiveBooleanIterator valueOfZeroAscii(String binarySnake) {
|
|
|
|
|
return valueOf(binarySnake, Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.STR_ZERO);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static PrimitiveBooleanIterator valueOf(String binarySnake, String zeroChar) {
|
|
|
|
|
OfInt values = binarySnake.codePoints().iterator();
|
|
|
|
|
int zeroInt = zeroChar.codePointAt(Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ZERO);
|
|
|
|
|
return new PrimitiveBooleanIterator() {
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean hasNext() {
|
|
|
|
|
return values.hasNext();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public boolean nextBoolean() {
|
|
|
|
|
return zeroInt != values.nextInt();
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
2022-10-23 03:04:55 +02:00
|
|
|
}
|