public class MultiEventHandler extends Object implements EventHandler
Modifier and Type | Field and Description |
---|---|
private List<EventHandler> |
handlers |
Constructor and Description |
---|
MultiEventHandler()
Create a new event handler.
|
Modifier and Type | Method and Description |
---|---|
void |
addEventHandler(EventHandler e)
Adds an event handler.
|
<T> void |
handleEvent(EventType<T> eventType,
T eventData,
BfsParser parser)
Resends the incoming event to all registered event handlers.
|
void |
removeEventHandler(EventHandler e)
Removes an event handler.
|
private List<EventHandler> handlers
public MultiEventHandler()
addEventHandler(EventHandler)
to add the event handlers that the events should be forwarded to.public void addEventHandler(EventHandler e)
public void removeEventHandler(EventHandler e)
public <T> void handleEvent(EventType<T> eventType, T eventData, BfsParser parser)
handleEvent
in interface EventHandler
eventType
- The type of event. See the parser documentation
for more information about the event types it generateseventData
- The data that is associated with the eventparser
- The parser that is resposible for parsing the file