|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mars_sim.msp.simulation.events.HistoricalEventManager
public class HistoricalEventManager
This class provides a manager that maintains a model of the events that have occured during the current simulation run. It provides support for a listener pattern so the external objects can be notified when new events have been registered. The manager maintains an ordered list in terms of descreasing time, i.e. most recent event first. It should be noted that the throughput of new events of the manager can be in the order of 100 event per simulation tick.
Field Summary | |
---|---|
static java.lang.String |
MALFUNCTION
|
static java.lang.String |
MEDICAL
|
static java.lang.String |
MISSION
|
static java.lang.String |
SUPPLY
|
static java.lang.String |
TASK
|
Constructor Summary | |
---|---|
HistoricalEventManager()
Create a new EventManager that represnets a particular simulation. |
Method Summary | |
---|---|
void |
addListener(HistoricalEventListener newListener)
Add a historical event listener |
HistoricalEvent |
getEvent(int index)
Get the event at a specified index. |
void |
registerNewEvent(HistoricalEvent newEvent)
An new event needs registering with the manager. |
void |
removeListener(HistoricalEventListener oldListener)
Removes a historical event listener. |
int |
size()
Get the number of events in the manager. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String MEDICAL
public static final java.lang.String MALFUNCTION
public static final java.lang.String MISSION
public static final java.lang.String TASK
public static final java.lang.String SUPPLY
Constructor Detail |
---|
public HistoricalEventManager()
Method Detail |
---|
public void addListener(HistoricalEventListener newListener)
newListener
- listener to add.public void removeListener(HistoricalEventListener oldListener)
oldListener
- listener to remove.public HistoricalEvent getEvent(int index)
index
- Index of event to retrieve.
public void registerNewEvent(HistoricalEvent newEvent)
newEvent
- The event to register.public int size()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |