io.sarl.api.util
Class SmartListenerCollection<T>
Type Parameters:
T -
All Superinterfaces:
ListenerNotifier
class SmartListenerCollection<T>
extends java.lang.Object
implements ListenerNotifier
A smart implementation of an event listeners' collection. This collection knows how to schedule the calls to the listeners.
Maven Group Identifier:
io.sarl.sdk
Maven Artifact Identifier:
api.util
Since:
0.10
Constructor Summary
Constructor and description
new(ListenerNotifier)
Constructor.
Action Summary
Modifier and type Action and description
void notifyListeners(Class<T>,Consumer<T>)
Build a call policy for the given list of listeners and call them.
void notifyListeners(EventListener,Consumer<T>)
Constructor Details
new(ListenerNotifier)
new(ListenerNotifier)
Constructor.
Parameters:
notifier - is the notifier to the listeners that must be used by this collection.
Action Details
notifyListeners(Class<T>,Consumer<T>)
def notifyListeners(Class<T>,Consumer<T>)

with L extends java.util.EventListener

Build a call policy for the given list of listeners and call them.
Parameters:
<L> - the type of event listener to support.
type - the type of the listeners to be called.
action - is the action to apply on each listener.
notifyListeners(EventListener,Consumer<T>)
def notifyListeners(EventListener,Consumer<T>)

with L extends java.util.EventListener