public interface

IEventSource

com.pnfsoftware.jeb.util.events.IEventSource
Known Indirect Subclasses

Class Overview

Interface for objects generating events, with optional relaying to a parent source.

Summary

Public Methods
abstract void addListener(IEventListener listener)
Register a listener.
abstract int countListeners()
Get the numbers of objects listening to this event source.
abstract List<? extends IEventListener> getListeners()
Get a copy of the list of listeners.
abstract IEventSource getParentSource()
Get the parent source.
abstract void insertListener(int index, IEventListener listener)
Register a listener.
abstract void notifyListeners(IEvent e)
Notify listeners that an event has occurred.
abstract void removeListener(IEventListener listener)
Unregister a listener.
abstract void setParentSource(IEventSource parentSource)
Set a parent source.

Public Methods

public abstract void addListener (IEventListener listener)

Register a listener. The listener is appended to the existing list of listeners. The implementor may allow duplicates.

Parameters
listener a listener of events generated by this source

public abstract int countListeners ()

Get the numbers of objects listening to this event source.

Returns
  • the number of listeners

public abstract List<? extends IEventListener> getListeners ()

Get a copy of the list of listeners.

public abstract IEventSource getParentSource ()

Get the parent source.

Returns
  • the parent source, or null if none

public abstract void insertListener (int index, IEventListener listener)

Register a listener. The implementor may allow duplicates.

Parameters
index insertion point
listener a listener of events generated by this source

public abstract void notifyListeners (IEvent e)

Notify listeners that an event has occurred.

Parameters
e the event to be propagated

public abstract void removeListener (IEventListener listener)

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

Parameters
listener the listener to be removed

public abstract void setParentSource (IEventSource parentSource)

Set a parent source.

Parameters
parentSource the optional parent source