Class OceanusEventRegistrar<E extends Enum<E>>
java.lang.Object
io.github.tonywasher.joceanus.oceanus.event.OceanusEventRegistrar<E>
- Type Parameters:
E- The event id type
EventRegister implementation. This maintains a list of
Action/Change/ItemListeners/ActionListeners and allows the caller to fire
Action/Change/ItemEvents and ActionEvents to these listeners. This is implemented to provide
functionality to non-GUI components and also to enable improved control over the contents of the
ChangeEvents and ActionEvents that are fired.
This class is used by listeners to register to listen for events.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceOceanusEventRegistrar.OceanusEventProvider<E extends Enum<E>>Interface for event providers. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddEventListener(E pEventId, OceanusEvent.OceanusEventListener<E> pListener) Add filtered event Listener to list.addEventListener(OceanusEvent.OceanusEventListener<E> pListener) Add event Listener to list.protected Iterator<OceanusEventRegistration<E>> iterator()Obtain registration iterator.voidremoveEventListener(OceanusEventRegistration<E> pRegistration) Remove Event Listener.(package private) ListIterator<OceanusEventRegistration<E>> Obtain reverse registration iterator.
-
Constructor Details
-
OceanusEventRegistrar
Constructor.- Parameters:
pMgrId- the manager id
-
-
Method Details
-
iterator
Obtain registration iterator.- Returns:
- the iterator
-
reverseIterator
ListIterator<OceanusEventRegistration<E>> reverseIterator()Obtain reverse registration iterator.- Returns:
- the iterator
-
addEventListener
Add event Listener to list.- Parameters:
pListener- the listener to add- Returns:
- the registration
-
addEventListener
public OceanusEventRegistration<E> addEventListener(E pEventId, OceanusEvent.OceanusEventListener<E> pListener) Add filtered event Listener to list.- Parameters:
pEventId- the explicit event id to listen forpListener- the listener to add- Returns:
- the registration
-
removeEventListener
Remove Event Listener.- Parameters:
pRegistration- the registration to remove
-