|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mars_sim.msp.core.events.HistoricalEventManager
public class HistoricalEventManager
This class provides a manager that maintains a model of the events that have occurred 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 decreasing 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 String |
MALFUNCTION
|
static String |
MEDICAL
|
static String |
MISSION
|
static String |
TASK
|
static String |
TRANSPORT
|
| Constructor Summary | |
|---|---|
HistoricalEventManager()
Create a new EventManager that represents a particular simulation. |
|
| Method Summary | |
|---|---|
void |
addListener(HistoricalEventListener newListener)
Add a historical event listener |
void |
destroy()
Prepare object for garbage collection. |
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 String MEDICAL
public static final String MALFUNCTION
public static final String MISSION
public static final String TASK
public static final String TRANSPORT
| 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()
public void destroy()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||