|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectch.sahits.game.openpatrician.model.time.PeriodicalTimeUpdater
public class PeriodicalTimeUpdater
The periodical time updater encapsules clock ticks of instances that are interested in
notification but only on a periodical level. The period may vary but the implementation is
always the same. The periods as defined in EUpdateIntervalRegistration are possible,
where as a year is composed by 365 days and a month has always 30 days. So these periods are
not really exact.
| Field Summary | |
|---|---|
private Date |
date
|
private IPeriodicalUpdate |
listener
Instance that is to be notified |
private int |
tickInterval
Period of the clock ticking |
private int |
timePassed
Time passed since the last notification |
private int |
updateInterval
Period that the listener should be notified |
| Constructor Summary | |
|---|---|
PeriodicalTimeUpdater(EUpdateIntervalRegistration intervall,
IPeriodicalUpdate listener)
|
|
| Method Summary | |
|---|---|
void |
stop()
Stop notifiyng the listener |
void |
ticked()
Clock ticked once |
void |
updateTick(int minutes)
The update size of a tick changed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private int tickInterval
private final Date date
private final int updateInterval
private int timePassed
private IPeriodicalUpdate listener
| Constructor Detail |
|---|
public PeriodicalTimeUpdater(EUpdateIntervalRegistration intervall,
IPeriodicalUpdate listener)
| Method Detail |
|---|
public void stop()
public void updateTick(int minutes)
IClockUpdateListener
updateTick in interface IClockUpdateListenerminutes - new tick size in minutespublic void ticked()
IClockUpdateListener
ticked in interface IClockUpdateListener
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||