JPP: Fixed unicode block enum name and make kaas chef use less resources
All checks were successful
Run test asserts / Test-Asserts (push) Successful in 42s

This commit is contained in:
Willem Cazander 2026-03-22 14:49:51 +01:00
parent d78bd5ff46
commit 35d913d6bb
2 changed files with 22 additions and 12 deletions

View file

@ -30,8 +30,8 @@ package ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᐪᓫᕽᐪ.ᓑᣕᣳᒼᐤᒄᓫ;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public enum UnicodePlane {
// TODO: rewrite interface type per plane
public enum UnicodeBlock {
// TODO: rewrite interface type per block
// =========== PLANE 0
@ -398,11 +398,11 @@ public enum UnicodePlane {
private final int stop;
private final boolean leftToRight;
private UnicodePlane(int start, int stop) {
private UnicodeBlock(int start, int stop) {
this(start, stop, true);
}
private UnicodePlane(int start, int stop, boolean leftToRight) {
private UnicodeBlock(int start, int stop, boolean leftToRight) {
this.start = start;
this.stop = stop;
this.leftToRight = leftToRight;
@ -428,12 +428,12 @@ public enum UnicodePlane {
return this != UNKNOWN;
}
public static UnicodePlane valueOfUnicode(int unicode) {
for (UnicodePlane value:values()) {
public static UnicodeBlock valueOfUnicode(int unicode) {
for (UnicodeBlock value:values()) {
if (unicode >= value.getStart() && unicode <= value.getStop()) {
return value;
}
}
return UnicodePlane.UNKNOWN;
return UnicodeBlock.UNKNOWN;
}
}

View file

@ -27,6 +27,7 @@
package ᒢᣘᐧᐧ.ᑊᑉᣔᣔᔆ;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.util.Arrays;
import java.util.Collection;
@ -57,23 +58,32 @@ public final class KaasChef {
return !kaas.isEnum() && !kaas.isInterface() && !kaas.isAnnotation();
}
// TODO: remove iterator so rewrite to "normal classic fast index based downwards counting for loop" or normalized as NCFIBDCFL
public boolean tasteInterfaceMethodisch(Class<?> kaas) {
if (!kaas.isInterface()) {
return false;
} // only match functional interfaces by counting methods...
return Arrays.asList(kaas.getDeclaredMethods()).stream().filter(m -> Modifier.isAbstract(m.getModifiers())).count() == 1;
return countAbstractMethods(kaas.getDeclaredMethods()) == 1;
}
// TODO: remove iterator so rewrite to "normal classic fast index based downwards counting for loop" or normalized as NCFIBDCFL
public boolean tasteInterfaceDriced(final Class<?> kaas) {
if (!kaas.isInterface()) {
return false;
}
if (kaas.getDeclaredMethods().length == 0) {
Method[] kaasMethods = kaas.getDeclaredMethods();
if (kaasMethods.length == 0) {
return false;
} // only match dry iced interfaces
return Arrays.asList(kaas.getDeclaredMethods()).stream().filter(m -> Modifier.isAbstract(m.getModifiers())).count() == 0;
return countAbstractMethods(kaasMethods) == 0;
}
private int countAbstractMethods(final Method[] kaasMethods) {
int count = 0;
for (int i = kaasMethods.length - 1; i >= 0; i--) {
if (Modifier.isAbstract(kaasMethods[i].getModifiers())) {
count++;
}
}
return count;
}
public List<Class<?>> cookPermittedSubclassesSortedNaturel(Class<?> kaas) {