Class SimuTimer<T extends Comparable<? super T>>
java.lang.Object
madkit.simulation.scheduler.SimuTimer<T>
- Type Parameters:
T
- the type used for modeling the time
- Direct Known Subclasses:
DateBasedTimer
,TickBasedTimer
Class representing time in a simulation.
- Since:
- MaDKit 6.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the current time objectReturns the ending time objectReturns the starting timeReturns a label synchronized with the current time.boolean
Checks if this timer has reached its end time.void
reset()
Resets the timer to its initial time.void
setCurrentTime
(T currentTime) Sets the current time objectvoid
setEndTime
(T endTime) Sets the ending time objectvoid
setStartTime
(T startTime) Sets the starting timevoid
setTimeFormat
(String format) Sets the formatting of the current time as specified inFormatter
.toString()
To string.
-
Constructor Details
-
SimuTimer
-
-
Method Details
-
hasReachedEndTime
public boolean hasReachedEndTime()Checks if this timer has reached its end time.- Returns:
true
if the current time has reached the end time.
-
getTimeLabel
Returns a label synchronized with the current time.- Returns:
- a label to be used in UI
-
setTimeFormat
-
getCurrentTime
-
setCurrentTime
Sets the current time object- Parameters:
currentTime
- the currentTime to set
-
getEndTime
-
setEndTime
Sets the ending time object- Parameters:
endTime
- the endTime to set
-
toString
-
reset
public void reset()Resets the timer to its initial time. -
getStartTime
-
setStartTime
Sets the starting time- Parameters:
startTime
- the startTime to set
-