Contents
Class EventBusRegistry.EventConsumerMap<EventType extends IBaseEvent, ConsumerType extends EventBusRegistry.EventConsumer, ReturnType>
java.lang.Object
com.hypixel.hytale.event.EventBusRegistry.EventConsumerMap<EventType, ConsumerType, ReturnType>
- Type Parameters:
EventType- The class type of event.ConsumerType- The class type of event consumer.ReturnType- The return type of the event dispatcher.
- All Implemented Interfaces:
IEventDispatcher<EventType, ReturnType>
- Enclosing class:
EventBusRegistry<KeyType, EventType extends IBaseEvent<KeyType>, ConsumerMapType extends EventBusRegistry.EventConsumerMap<EventType, ?, ?>>
public abstract static class EventBusRegistry.EventConsumerMap<EventType extends IBaseEvent, ConsumerType extends EventBusRegistry.EventConsumer, ReturnType>
extends Object
implements IEventDispatcher<EventType, ReturnType>
A class that represents a map of event consumers organized by priority.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(ConsumerType eventConsumer) Called to add the given event consumer to this consumer map.get(short priority) Called to get a list of event consumers for the given priority.short[]booleanisEmpty()booleanremove(ConsumerType consumer) Called to remove the given event consumer from this consumer map.Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface IEventDispatcher
dispatch, hasListener
-
Constructor Details
-
EventConsumerMap
public EventConsumerMap()
-
-
Method Details
-
isEmpty
public boolean isEmpty()- Returns:
trueif this consumer map is empty,falseotherwise.
-
add
Called to add the given event consumer to this consumer map.- Parameters:
eventConsumer- The event consumer to add.
-
remove
Called to remove the given event consumer from this consumer map.- Parameters:
consumer- The event consumer to remove.- Returns:
trueif the consumer was removed,falseotherwise.
-
getPriorities
public short[] getPriorities()- Returns:
- the array of priorities in this consumer map.
-
get
Called to get a list of event consumers for the given priority.- Parameters:
priority- The priority to get consumers for.- Returns:
- the list of event consumers for the given priority, or
nullif none exist.
-