jasi.sim.basic.control
Class AbstractSimListener

java.lang.Object
  extended by jasi.sim.basic.control.AbstractSimListener
All Implemented Interfaces:
SimListener, ElementsListener, CalendarListener
Direct Known Subclasses:
AbstractSimController

public abstract class AbstractSimListener
extends java.lang.Object
implements SimListener

A basic adapter for observers of simulation state changes. This adapter provides only empty methods, but other observers can be easily adapted by extension of this class and overloading some or all of its methods.


Constructor Summary
AbstractSimListener()
           
 
Method Summary
 void advancedTime(Time time, double speed)
          A time advance has been granted.
<T> void
changedElement(Element element, java.lang.String name, T value)
          A simulation element has changed its state.
 void createdElement(Element element)
          A simulation element has been created.
 void deletedElement(Element element)
          A simulation element has been deleted.
 void finishedReadingArchive()
          The simulation archive was read.
 void finishedSimulation(Time time)
          A simulation thread has been finished.
 void finishedWritingArchive()
          The simulation archive was written.
 void gotException(java.lang.Exception e)
          An exception occurred during simulation.
 void gotMessage(java.lang.String m)
          An message was created by the simulation.
 void poppedEvent(Event event)
          An event has been popped from the calendar and was executed by a simulation model.
 void pushedEvent(Event event)
          An event has been pushed to the simulation calendar.
 void removedEvent(Event event)
          An event has been removed from the simulation calendar.
<T> void
requestedElement(Element element, java.lang.String name, T value)
          The attribute value of a simulation element has been read.
 void startedSimulation(Time time)
          A simulation thread has been started.
 void startReadingArchive(java.lang.String file)
          The simulation archive is read.
 void startWritingArchive(java.lang.String file)
          The simulation archive is written.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractSimListener

public AbstractSimListener()
Method Detail

pushedEvent

public void pushedEvent(Event event)
An event has been pushed to the simulation calendar.

Specified by:
pushedEvent in interface CalendarListener
Parameters:
event - The pushed event.

poppedEvent

public void poppedEvent(Event event)
An event has been popped from the calendar and was executed by a simulation model.

Specified by:
poppedEvent in interface CalendarListener
Parameters:
event - The popped event.

removedEvent

public void removedEvent(Event event)
An event has been removed from the simulation calendar.

Specified by:
removedEvent in interface CalendarListener
Parameters:
event - The removed event.

startedSimulation

public void startedSimulation(Time time)
A simulation thread has been started.

Specified by:
startedSimulation in interface SimListener
Parameters:
time - The current time.

finishedSimulation

public void finishedSimulation(Time time)
A simulation thread has been finished.

Specified by:
finishedSimulation in interface SimListener
Parameters:
time - The current time.

createdElement

public void createdElement(Element element)
A simulation element has been created.

Specified by:
createdElement in interface ElementsListener
Parameters:
element - The newly created element.

changedElement

public <T> void changedElement(Element element,
                               java.lang.String name,
                               T value)
A simulation element has changed its state.

Specified by:
changedElement in interface ElementsListener
Type Parameters:
T - The value type.
Parameters:
element - The newly created element.
name - The attribute's name.
value - The new value of the attribute.

requestedElement

public <T> void requestedElement(Element element,
                                 java.lang.String name,
                                 T value)
The attribute value of a simulation element has been read.

Specified by:
requestedElement in interface ElementsListener
Type Parameters:
T - The value type.
Parameters:
element - The simulation element.
name - The attribute's name.
value - The value of the attribute.

deletedElement

public void deletedElement(Element element)
A simulation element has been deleted.

Specified by:
deletedElement in interface ElementsListener
Parameters:
element - The deleted element.

advancedTime

public void advancedTime(Time time,
                         double speed)
A time advance has been granted.

Specified by:
advancedTime in interface SimListener
Parameters:
time - The granted time advance.
speed - The simulation speed in factors of real time.

startReadingArchive

public void startReadingArchive(java.lang.String file)
The simulation archive is read.

Specified by:
startReadingArchive in interface SimListener
Parameters:
file - The file name of the archive.

finishedReadingArchive

public void finishedReadingArchive()
The simulation archive was read.

Specified by:
finishedReadingArchive in interface SimListener

startWritingArchive

public void startWritingArchive(java.lang.String file)
The simulation archive is written.

Specified by:
startWritingArchive in interface SimListener
Parameters:
file - The file name of the archive.

finishedWritingArchive

public void finishedWritingArchive()
The simulation archive was written.

Specified by:
finishedWritingArchive in interface SimListener

gotException

public void gotException(java.lang.Exception e)
An exception occurred during simulation.

Specified by:
gotException in interface SimListener
Parameters:
e - The exception.

gotMessage

public void gotMessage(java.lang.String m)
An message was created by the simulation.

Specified by:
gotMessage in interface SimListener
Parameters:
m - The message.