| java.lang.Object | |
| ↳ | com.neomades.event.EventBus |
The EventBus maintains a collection of EventReceivers and an
String eventType they are associated with.
Any Event can be posted, and any eventType can associate itself with
an EventReceiver. Care is required in correctly managing your
registered objects, you must ensure that they are unregistered when no longer
needed.
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| EventBus() | |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| boolean | isEnabled() | ||||||||||
| void |
register(String eventType, EventReceiver handler)
Registers an EventListener to an EventType
| ||||||||||
| void |
register(EventReceiver handler)
Register an
EventReceiver which would be aware about all event inside
the bus | ||||||||||
| void |
send(Event event)
Send an event to listeners
| ||||||||||
| void |
setEnabled(boolean enabled)
Enables or not this bus
| ||||||||||
| void |
unregister(EventReceiver handler)
Unregisters an EventListener whatever the event type.
| ||||||||||
| void |
unregister(String eventType, EventReceiver handler)
Unregisters an EventListener to an EventType.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Registers an EventListener to an EventType
Register an EventReceiver which would be aware about all event inside
the bus
Enables or not this bus
| enabled | true to enabled |
|---|
Unregisters an EventListener whatever the event type.
Unregisters an EventListener to an EventType.