Cached length
This commit is contained in:
parent
9c1161e84c
commit
3acc28dbbf
9 changed files with 97 additions and 29 deletions
|
|
@ -13,6 +13,7 @@ public enum BãßBȍőnPartKeyʸᴰ implements BãßBȍőnCoffinStoreKeyʸᴰ {
|
|||
|
||||
MAP_TONE,
|
||||
MAP_CHINA,
|
||||
MAP_CACHE,
|
||||
|
||||
ALT_1_VALUE,
|
||||
ALT_2_VALUE,
|
||||
|
|
|
|||
|
|
@ -5,22 +5,13 @@ import java.util.Map;
|
|||
import love.distributedrebirth.bassboonyd.BãßBȍőnAuthorInfoʸᴰ;
|
||||
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinOpenʸᴰ;
|
||||
import love.distributedrebirth.bassboonyd.BãßBȍőnCoffinStoreʸᴰ;
|
||||
import love.distributedrebirth.bassboonyd.BãßBȍőnInitMarkerʸᴰ;
|
||||
import love.distributedrebirth.bassboonyd.DefaultEnumSetʸᴰ;
|
||||
import love.distributedrebirth.bassboonyd.BãßBȍőnInitMethodʸᴰ;
|
||||
|
||||
@BãßBȍőnAuthorInfoʸᴰ(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
|
||||
public interface BãßBȍőnPartʸᴰ<T extends BãßBȍőnPartʸᴰ<T>> extends DefaultEnumSetʸᴰ<T>, BãßBȍőnCoffinStoreʸᴰ<BãßBȍőnPartKeyʸᴰ> {
|
||||
|
||||
@BãßBȍőnInitMethodʸᴰ
|
||||
default void initMapTone(BãßBȍőnCoffinOpenʸᴰ<BãßBȍőnPartKeyʸᴰ> BBC) {
|
||||
BBC.PUT_MAP(BãßBȍőnPartKeyʸᴰ.MAP_TONE);
|
||||
}
|
||||
|
||||
@BãßBȍőnInitMethodʸᴰ
|
||||
default void initMapChina(BãßBȍőnCoffinOpenʸᴰ<BãßBȍőnPartKeyʸᴰ> BBC) {
|
||||
BBC.PUT_MAP(BãßBȍőnPartKeyʸᴰ.MAP_CHINA);
|
||||
}
|
||||
|
||||
default String BȍőnDialTone() {
|
||||
return GET_BBC().GET_STR(BãßBȍőnPartKeyʸᴰ.DIAL_TONE);
|
||||
}
|
||||
|
|
@ -50,4 +41,36 @@ public interface BãßBȍőnPartʸᴰ<T extends BãßBȍőnPartʸᴰ<T>> extends
|
|||
}
|
||||
return (T) mapChina.get(chinaKey);
|
||||
}
|
||||
|
||||
public static class Init implements BãßBȍőnInitMarkerʸᴰ {
|
||||
|
||||
@BãßBȍőnInitMethodʸᴰ
|
||||
private static void initMapTone(BãßBȍőnCoffinOpenʸᴰ<BãßBȍőnPartKeyʸᴰ> BBC) {
|
||||
BBC.PUT_MAP(BãßBȍőnPartKeyʸᴰ.MAP_TONE);
|
||||
}
|
||||
|
||||
@BãßBȍőnInitMethodʸᴰ
|
||||
private static void initMapChina(BãßBȍőnCoffinOpenʸᴰ<BãßBȍőnPartKeyʸᴰ> BBC) {
|
||||
BBC.PUT_MAP(BãßBȍőnPartKeyʸᴰ.MAP_CHINA);
|
||||
}
|
||||
|
||||
@BãßBȍőnInitMethodʸᴰ
|
||||
private static void initMapCache(BãßBȍőnCoffinOpenʸᴰ<BãßBȍőnPartKeyʸᴰ> BBC) {
|
||||
BBC.PUT_MAP(BãßBȍőnPartKeyʸᴰ.MAP_CACHE);
|
||||
}
|
||||
}
|
||||
|
||||
public static class MapCacheKey {
|
||||
private static final String LENGTH = "length";
|
||||
}
|
||||
|
||||
default int BãßĦǿɇṽḝę̃ɬḪễïđ() {
|
||||
Map<String,Object> mapCache = GET_BBC().GET_MAP_OBJ(BãßBȍőnPartKeyʸᴰ.MAP_CACHE);
|
||||
Integer length = Integer.class.cast(mapCache.get(MapCacheKey.LENGTH));
|
||||
if (length == null) {
|
||||
length = BãßInstances().length;
|
||||
mapCache.put(MapCacheKey.LENGTH, length);
|
||||
}
|
||||
return length;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue