|
ContactCenters V. 0.9.9. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface ContactSource
Represents a contact source which produces
contacts during a simulation.
Before any simulation replication,
any contact source needs to be initialized.
Since initialization disables the source, the source
must be enabled to produce contacts.
When a contact is produced,
the contact source should instantiate a Contact object
using a user-specified ContactFactory implementation,
or pick an instance from an internal list.
It should then notify the new contact to any registered
NewContactListener implementation.
| Method Summary | |
|---|---|
void |
addNewContactListener(NewContactListener listener)
Adds the listener listener to be notified when a new contact is produced. |
void |
clearNewContactListeners()
Clears the list of new-contact listeners associated with this contact source. |
List<NewContactListener> |
getNewContactListeners()
Returns an unmodifiable list containing all the new-contact listeners registered with this contact source. |
void |
init()
Initializes the contact source for a new replication of a simulation. |
void |
removeNewContactListener(NewContactListener listener)
Removes the new-contact listener listener from the list associated with this contact source. |
void |
setSimulator(Simulator sim)
Sets the simulator attached to this contact source to sim. |
Simulator |
simulator()
Returns a reference to the simulator associated with this contact source. |
| Methods inherited from interface umontreal.iro.lecuyer.contactcenters.ToggleElement |
|---|
isStarted, start, stop |
| Methods inherited from interface umontreal.iro.lecuyer.contactcenters.Named |
|---|
getName, setName |
| Method Detail |
|---|
void init()
init in interface Initializablevoid addNewContactListener(NewContactListener listener)
listener - the new-contact listener being added.
NullPointerException - if listener is null.void removeNewContactListener(NewContactListener listener)
listener - the new-contact listener being removed.void clearNewContactListeners()
List<NewContactListener> getNewContactListeners()
Simulator simulator()
Any implementation of this interface
should provide a constructor
accepting the simulator as an argument.
Constructors not receiving a simulator
should use the default simulator
returned by Simulator.getDefaultSimulator().
void setSimulator(Simulator sim)
sim - the new simulator.
NullPointerException - if
sim is null.
|
ContactCenters V. 0.9.9. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||