76 lines
2.3 KiB
Java
76 lines
2.3 KiB
Java
package love.distributedrebirth.bassboonyd;
|
||
|
||
import java.util.Arrays;
|
||
import java.util.List;
|
||
import java.util.Map;
|
||
import java.util.function.Consumer;
|
||
import java.util.function.Function;
|
||
import java.util.stream.Collectors;
|
||
|
||
import love.distributedrebirth.bassboonyd.info.BãßBȍőnAuthor注;
|
||
|
||
@BãßBȍőnAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||
public interface DefaultEnumSetʸᴰ<T, K extends BãßBȍőnCoffinStoreKeyʸᴰ> extends DefaultEnumBaseʸᴰ<T,K> {
|
||
|
||
public static class Ꝑŕḯṿª₮ḕ implements BãßBȍőnꝐŕḯṿª₮ḕ {
|
||
private static final String GHOST_KEY_RANG_TEL_EEN = "rangTelEen";
|
||
|
||
@BãßBȍőnꝐŕḯṿª₮ḕInit注()
|
||
private static void init(DefaultEnumSetʸᴰ<?,?> boon) {
|
||
boon.toBBC().UNHOLY(Ꝑŕḯṿª₮ḕ.class).PUT_GHOST(GHOST_KEY_RANG_TEL_EEN, boon.BȍőnRangTelNul() + BãßBȍőnConstantsʸᴰ.INT_ONE);
|
||
}
|
||
}
|
||
|
||
default int BȍőnRangTelNul() {
|
||
return ordinal();
|
||
}
|
||
|
||
default int BȍőnRangTelEen() {
|
||
return toBBC().UNHOLY(Ꝑŕḯṿª₮ḕ.class).GHOST_INT(Ꝑŕḯṿª₮ḕ.GHOST_KEY_RANG_TEL_EEN);
|
||
}
|
||
|
||
default List<T> BãßInstancesList() {
|
||
return Arrays.asList(BãßInstances());
|
||
}
|
||
|
||
default Map<String,T> BãßInstancesToMap(Function<T,String> keyMapper) {
|
||
return BãßInstancesList().stream().collect(Collectors.toMap(keyMapper, v -> v));
|
||
}
|
||
|
||
default T BȍőnVolgende() {
|
||
T[] values = BãßInstances();
|
||
int resultIndex = BãßBȍőnConstantsʸᴰ.INT_ZERO;
|
||
for (int i=BãßBȍőnConstantsʸᴰ.INT_ZERO;i<values.length;i++) {
|
||
if (this == values[i]) {
|
||
resultIndex = i + BãßBȍőnConstantsʸᴰ.INT_ONE;
|
||
break;
|
||
}
|
||
}
|
||
if (resultIndex == values.length) {
|
||
resultIndex = BãßBȍőnConstantsʸᴰ.INT_ZERO;
|
||
}
|
||
return values[resultIndex];
|
||
}
|
||
|
||
default T BȍőnVorige() {
|
||
T[] values = BãßInstances();
|
||
int resultIndex = BãßBȍőnConstantsʸᴰ.INT_ZERO;
|
||
for (int i=BãßBȍőnConstantsʸᴰ.INT_ZERO;i<values.length;i++) {
|
||
if (this == values[i]) {
|
||
resultIndex = i - BãßBȍőnConstantsʸᴰ.INT_ONE;
|
||
break;
|
||
}
|
||
}
|
||
if (resultIndex < BãßBȍőnConstantsʸᴰ.INT_ZERO) {
|
||
resultIndex = values.length - BãßBȍőnConstantsʸᴰ.INT_ONE;
|
||
}
|
||
return values[resultIndex];
|
||
}
|
||
|
||
default void BãßVoorElk(Consumer<T> consumer) {
|
||
for (T value:BãßInstances()) {
|
||
consumer.accept(value);
|
||
}
|
||
}
|
||
}
|