类 EphemeralRegistry
java.lang.Object
pkg.exoad.poprock.core.registry.BaseRegistry
pkg.exoad.poprock.core.registry.EphemeralRegistry
- 所有已实现的接口:
- Serializable,- DebuggableMixin,- SelfReportingMixin,- ITypeInferencing<Collection<Class<? extends RegistryEntry>>>,- NamedObjMixin
public final class EphemeralRegistry
extends BaseRegistry
implements DebuggableMixin, NamedObjMixin, Serializable
Ephemeral Registry
An EphemeralRegistry is the most basic registry type. By basic meaning that any functionality that depends on this registry must perform manual lookup within this registry. This means when a property is changed, no MVC pattern is implemented by the registry.However, you can get around this by using a registry entry's internal checker function as a listener. However, sometimes this is not guranteed to be called.
Leaf Validation
Leaf validation defines how properties flow within the registry. This just means what happens when the program wants to set an entry's value to something else. For the most part, this is quite trivial, we call the entry's checker function and see what it shows and do the appropriate operation based on the result. However, Ephemeral Registry also performs a few optimizations on behalf of the entries themselves. One of the biggest is basic object equality. If the current entry's value is already equal to
- 另请参阅:
- 
嵌套类概要嵌套类修饰符和类型类说明static final recordThe configuration styling used for creating an ephemeral registry.
- 
字段概要字段修饰符和类型字段说明private final HashMap<String,RegistryEntry> The internal representation of all of the propertiesprivate static final CharSequence[]Internal conventions that are preserved从接口继承的字段 pkg.exoad.poprock.core.mixins.NamedObjMixinOBJECTS
- 
构造器概要构造器限定符构造器说明privateEphemeralRegistry(String rootName) Initiates a new Ephemeral Registry by using just the rootName(专用程序包)EphemeralRegistry(String rootName, float loadFactor, Pair<String, RegistryEntry>[] entries) Initiates a new Ephemeral Reigstry with some more parameters.
- 
方法概要修饰符和类型方法说明protected RegistryEntryacquireEntry(String leafName) Returns the internal representation of a leaf.private static StringassertLeafNameFormat(String rootName) Formats the rootName accordingly.protected voidAn internal iterable instance (should not be exposed by reflection)Optional<Collection<Class<? extends RegistryEntry>>>The class may or may not return a valid type inferencing due to internal reasons, so anOptionalis returned.makeConfig(String rootName) Similar to justmakeConfig(String,float,Pair[])but just with one required parameter.makeConfig(String rootName, float loadFactor, Pair<String, RegistryEntry>[] entries) Creates a configuration functionallyvoidregisterEntry(String name, RegistryEntry entry) This method is the main entry into "putting" a leaf into a registry.从类继承的方法 pkg.exoad.poprock.core.registry.BaseRegistryacquireEntryCanonicalName, acquireEntryValue从类继承的方法 java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait从接口继承的方法 pkg.exoad.poprock.core.debug.DebuggableMixinLOG, THROW_NOW, THROW_NOW_IF从接口继承的方法 pkg.exoad.poprock.core.mixins.NamedObjMixingetObjectName, setObjectName, withObjectName从接口继承的方法 pkg.exoad.poprock.core.debug.SelfReportingMixingetCanonicallyNamedThis, getNamedThis
- 
字段详细资料- 
NOT_ALLOWED_SEQUENCESInternal conventions that are preserved
- 
leavesThe internal representation of all of the properties
 
- 
- 
构造器详细资料- 
EphemeralRegistryInitiates a new Ephemeral Registry by using just the rootName- 参数:
- rootName- The name to use for this registry (this is descriptive)
 
- 
EphemeralRegistry@VolatileImpl(reason="load factor less than 0") EphemeralRegistry(String rootName, float loadFactor, Pair<String, RegistryEntry>[] entries) Initiates a new Ephemeral Reigstry with some more parameters.- 参数:
- rootName- The name to use for this registry (this is descriptive)
- loadFactor- The load factor to use for the internal backing hash table
- entries- Any default entries that can be emplaced into the hashtable
 
 
- 
- 
方法详细资料- 
assertLeafNameFormat@VolatileImpl(reason="The supplied rootName contains invalid characters") private static String assertLeafNameFormat(String rootName) Formats the rootName accordingly. If the root name is invalid, this function throws an exception which is always a programming error.- 参数:
- rootName- The rootname
- 返回:
- The formatted rootname.
 
- 
makeConfigSimilar to justmakeConfig(String,float,Pair[])but just with one required parameter.- 参数:
- rootName- REQUIRED - the root node's name
- 返回:
- the config
- 另请参阅:
 
- 
makeConfigpublic static EphemeralRegistry.EphemeralRegistryConfig makeConfig(String rootName, float loadFactor, Pair<String, RegistryEntry>[] entries) Creates a configuration functionally- 参数:
- rootName- REQUIRED - the root node's name
- loadFactor- OPTIONAL - the load factor used for the internal hashtable for performance optimization. By default this value is 0 .75 (float)
- entries- OPTIONAL - default entries to inject into the internal hashtable
- 返回:
- the config
- 另请参阅:
 
- 
registerEntry@VolatileImpl(reason="The supplied leaf was already registered.") public void registerEntry(String name, RegistryEntry entry) 从类复制的说明:BaseRegistryThis method is the main entry into "putting" a leaf into a registry. It acts similar to the registration process used byEventPoolService.- 指定者:
- registerEntry在类中- BaseRegistry
- 参数:
- name- The name of the leaf
- entry- The base modal of the leaf (property)
- 另请参阅:
 
- 
acquireEntry@VolatileImpl(reason="The supplied leaf was not found.") protected RegistryEntry acquireEntry(String leafName) 从类复制的说明:BaseRegistryReturns the internal representation of a leaf.Note that this method must handle an invalid name - 指定者:
- acquireEntry在类中- BaseRegistry
- 参数:
- leafName- The name of the leaf to look up
- 返回:
- The RegistryEntry
 
- 
inferTyping从接口复制的说明:ITypeInferencingThe class may or may not return a valid type inferencing due to internal reasons, so anOptionalis returned.- 指定者:
- inferTyping在接口中- ITypeInferencing<Collection<Class<? extends RegistryEntry>>>
- 覆盖:
- inferTyping在类中- BaseRegistry
- 返回:
- The typing inferred from the internal representation of the class
 
- 
forEach从类复制的说明:BaseRegistryAn internal iterable instance (should not be exposed by reflection)- 指定者:
- forEach在类中- BaseRegistry
- 参数:
- e- Consumer
 
 
-