public class

EventSource2

extends Object
implements IEventSource2<E, T extends IEvent2<E>>
java.lang.Object
   ↳ com.pnfsoftware.jeb.util.events.deprecated_v2.impl.EventSource2<E>

Summary

Fields
protected List<IEventListener2<E>> listeners
protected IEventSource2<E, IEvent2<E>> parentSource
Public Constructors
EventSource2()
Public Methods
void addListener(IEventListener2<E> listener)
Register a listener.
int countListeners()
Get the numbers of objects listening to this event source.
IEventSource2<E, IEvent2<E>> getParentSource()
Get the parent source.
void notifyListeners(IEvent2<E> e)
Notify listeners that an event has occurred.
boolean removeListener(IEventListener2<E> listener)
Unregister a listener.
void setParentSource(IEventSource2<E, IEvent2<E>> parentSource)
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.pnfsoftware.jeb.util.events.deprecated_v2.IEventSource2

Fields

protected List<IEventListener2<E>> listeners

protected IEventSource2<E, IEvent2<E>> parentSource

Public Constructors

public EventSource2 ()

Public Methods

public void addListener (IEventListener2<E> listener)

Register a listener. The implementor may allow duplicates.

Parameters
listener a listener of events generated by this source

public int countListeners ()

Get the numbers of objects listening to this event source.

Returns
  • the number of listeners

public IEventSource2<E, IEvent2<E>> getParentSource ()

Get the parent source.

Returns
  • the parent source, or null if none

public void notifyListeners (IEvent2<E> e)

Notify listeners that an event has occurred.

Parameters
e the event to be propagated

public boolean removeListener (IEventListener2<E> listener)

Unregister a listener. If the implementor allows duplicates in addListener(), it should deal with those consistently.

Parameters
listener the listener to be removed
Returns
  • true if the listener was successfully removed, false

public void setParentSource (IEventSource2<E, IEvent2<E>> parentSource)