类 EventPoolService.EventPool
java.lang.Object
pkg.exoad.poprock.core.EventPoolService.EventPool
- 所有已实现的接口:
DebuggableMixin
,SelfReportingMixin
- 封闭类:
- EventPoolService
-
字段概要
-
构造器概要
-
方法概要
修饰符和类型方法说明void
attachListener
(Class<? extends EventPoolService.EventPayload> id, Runnable r) Subscribe to an event payload type<T extends EventPoolService.EventPayload>
voiddispatchEvent
(Class<T> id, T payload) <T extends EventPoolService.EventPayload>
TgetPayload
(Class<T> id) Returns the currently cached value of this payload event type (can be null).<T extends EventPoolService.EventPayload>
booleanisRegisteredPayloadID
(Class<T> id) <T extends EventPoolService.EventPayload>
voidDry runs all of the listeners under an event payload.void
registerEvent
(Class<? extends EventPoolService.EventPayload> id, Object payload) Register an event payload type to this pool.从类继承的方法 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.debug.SelfReportingMixin
getCanonicallyNamedThis, getNamedThis
-
字段详细资料
-
payloads
-
-
构造器详细资料
-
EventPool
public EventPool()
-
-
方法详细资料
-
attachListener
@VolatileImpl(reason="The suggested listener ID already exists") public void attachListener(Class<? extends EventPoolService.EventPayload> id, Runnable r) Subscribe to an event payload type- 参数:
id
- identifier of the payload typer
- The listener lambda (function)
-
registerEvent
Register an event payload type to this pool.- 参数:
id
- identifier of the payloadpayload
- initial value (usually null)
-
getPayload
@VolatileImpl(reason="Suggested ID does not exist!") public <T extends EventPoolService.EventPayload> T getPayload(Class<T> id) Returns the currently cached value of this payload event type (can be null).- 参数:
id
- idenitifier of the payload- 返回:
- the value of the payload
- 另请参阅:
-
ping
Dry runs all of the listeners under an event payload. This should be used sparingly as the currently cached value could be unexpected or dependent on when it is run.- 类型参数:
T
- identifier type- 参数:
id
- identifier of the payload
-
isRegisteredPayloadID
@NotVirtual public <T extends EventPoolService.EventPayload> boolean isRegisteredPayloadID(Class<T> id) -
dispatchEvent
-