class WakeUpManager extends Object
Modifier and Type | Field and Description |
---|---|
private TreeSet<Long> |
minTime
Verwaltet die Weckzeit aufsteigend sortiert.
|
private Hashtable<SimulationAutomaton,ArrayList<SimulationAutomaton>> |
simList
Simulation -> Liste in der die Simulation auftaucht.
|
private Hashtable<Long,ArrayList<SimulationAutomaton>> |
simulations
'Weckzeit' -> Liste mit aufzuweckenden Simulation
|
Constructor and Description |
---|
WakeUpManager() |
Modifier and Type | Method and Description |
---|---|
void |
addWakeUp(SimulationManager simManager,
SimulationAutomaton dfa,
long wakeUpTime)
Fügt die Weckzeit für eine Simulation hinzu.
|
void |
cancelWakeUp(SimulationAutomaton dfa)
Bricht das Aufwecken der übergebenen Simulation ab.
|
long |
timeToWakeUp()
Berechnet die Zeit in ms, in der Simulationen aufgeweckt werden müssen.
|
void |
wakeUp()
Weckt alle fälligen Simulationen auf.
|
private Hashtable<Long,ArrayList<SimulationAutomaton>> simulations
private Hashtable<SimulationAutomaton,ArrayList<SimulationAutomaton>> simList
public void wakeUp()
public void addWakeUp(SimulationManager simManager, SimulationAutomaton dfa, long wakeUpTime)
Thread.interrupt()
. falls die neue Weckzeit vor
der bisher nächsten Weckzeit liegt.simManager
- Simulationsverwaltungdfa
- Simulation die geweckt werden soll.wakeUpTime
- Weckzeit.public void cancelWakeUp(SimulationAutomaton dfa)
dfa
- Simulationpublic long timeToWakeUp()
1
, je nachdem welcher Wert größer ist. Wurde bisher noch keine
Weckzeit eingestellt, so wird 0
zurückgegeben.