public class DataManagerEventSource
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
DataManagerEventSource.EventFireTime
A set of possible event fire times
|
Constructor and Description |
---|
DataManagerEventSource()
Creates a new event source object
|
Modifier and Type | Method and Description |
---|---|
boolean |
addEventListener(DataManagerEventSource.EventFireTime when,
DataManagerEventListener listener)
Add a listener.
|
boolean |
addEventListenerWithPriority(DataManagerEventSource.EventFireTime when,
DataManagerEventListener listener,
int priority)
Add a listener with a specified execution priority
|
void |
fireEvent(DataManagerEventSource.EventFireTime when,
DataManagerEvent evt)
Fire event
|
java.util.List<DataManagerEventListener> |
getEventListeners(DataManagerEventSource.EventFireTime when)
retrieve all event listeners
|
boolean |
removeEventListener(DataManagerEventSource.EventFireTime when,
DataManagerEventListener listener)
remove a listener
|
public DataManagerEventSource()
public boolean addEventListener(@NotNull DataManagerEventSource.EventFireTime when, @NotNull DataManagerEventListener listener)
addEventListenerWithPriority(EventFireTime, DataManagerEventListener, int)
do not affect the auto increment counterwhen
- When the event should be triggeredlistener
- The listener that will handle the eventpublic boolean addEventListenerWithPriority(@NotNull DataManagerEventSource.EventFireTime when, @NotNull DataManagerEventListener listener, int priority)
when
- When the event should be triggeredlistener
- The listener that will handle the eventpriority
- The priority for the event, with lower numbers being higher prioritypublic boolean removeEventListener(@NotNull DataManagerEventSource.EventFireTime when, @NotNull DataManagerEventListener listener)
when
- When the event was triggeredlistener
- The listener that will be removed@NotNull public java.util.List<DataManagerEventListener> getEventListeners(@NotNull DataManagerEventSource.EventFireTime when)
when
- When the events are triggered that should be returnedpublic void fireEvent(@NotNull DataManagerEventSource.EventFireTime when, @NotNull DataManagerEvent evt)
when
- The time to fire the event. This indicates which list of events to use for firingevt
- The event that should be sent to each listener for the given time