类 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 record
The 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.NamedObjMixin
OBJECTS
-
构造器概要
限定符构造器说明private
EphemeralRegistry
(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 RegistryEntry
acquireEntry
(String leafName) Returns the internal representation of a leaf.private static String
assertLeafNameFormat
(String rootName) Formats the rootName accordingly.protected void
An 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 anOptional
is 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 functionallyvoid
registerEntry
(String name, RegistryEntry entry) This method is the main entry into "putting" a leaf into a registry.从类继承的方法 pkg.exoad.poprock.core.registry.BaseRegistry
acquireEntryCanonicalName, acquireEntryValue
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
从接口继承的方法 pkg.exoad.poprock.core.debug.DebuggableMixin
LOG, THROW_NOW, THROW_NOW_IF
从接口继承的方法 pkg.exoad.poprock.core.mixins.NamedObjMixin
getObjectName, setObjectName, withObjectName
从接口继承的方法 pkg.exoad.poprock.core.debug.SelfReportingMixin
getCanonicallyNamedThis, getNamedThis
-
字段详细资料
-
NOT_ALLOWED_SEQUENCES
Internal conventions that are preserved -
leaves
The internal representation of all of the properties
-
-
构造器详细资料
-
EphemeralRegistry
Initiates 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 tableentries
- 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.
-
makeConfig
Similar to justmakeConfig(String,float,Pair[])
but just with one required parameter.- 参数:
rootName
- REQUIRED - the root node's name- 返回:
- the config
- 另请参阅:
-
makeConfig
public static EphemeralRegistry.EphemeralRegistryConfig makeConfig(String rootName, float loadFactor, Pair<String, RegistryEntry>[] entries) Creates a configuration functionally- 参数:
rootName
- REQUIRED - the root node's nameloadFactor
- 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) 从类复制的说明:BaseRegistry
This 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 leafentry
- The base modal of the leaf (property)- 另请参阅:
-
acquireEntry
@VolatileImpl(reason="The supplied leaf was not found.") protected RegistryEntry acquireEntry(String leafName) 从类复制的说明:BaseRegistry
Returns 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
从接口复制的说明:ITypeInferencing
The class may or may not return a valid type inferencing due to internal reasons, so anOptional
is returned.- 指定者:
inferTyping
在接口中ITypeInferencing<Collection<Class<? extends RegistryEntry>>>
- 覆盖:
inferTyping
在类中BaseRegistry
- 返回:
- The typing inferred from the internal representation of the class
-
forEach
从类复制的说明:BaseRegistry
An internal iterable instance (should not be exposed by reflection)- 指定者:
forEach
在类中BaseRegistry
- 参数:
e
- Consumer
-