public class SimulationTime
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
SHOW_DATE |
static int |
SHOW_DATE_TIME |
static int |
SHOW_DATE_TIME_MILLIS |
static int |
SHOW_DAY |
static int |
SHOW_DAY_DATE_TIME_MILLIS_DST |
static int |
SHOW_DST |
static int |
SHOW_MILLIS |
static int |
SHOW_TIME |
static int |
SHOW_TIME_MILLIS |
static int |
SHOW_TIMEZONE |
Constructor and Description |
---|
SimulationTime(long start,
long end,
double speed,
java.util.TimeZone timezone,
java.util.Locale locale)
Constructor for SimulationTime
|
Modifier and Type | Method and Description |
---|---|
void |
cont()
when SimulationTime is on pause, then lets it go running.
|
long |
getSimulationEnd() |
long |
getSimulationStart() |
long |
getSimulationTime() |
double |
getSpeed()
get simulation-speed
|
static java.lang.String |
getTimeString(long time,
int format)
convert the time value to human-readable format.
|
static java.lang.String |
getTimeZoneString() |
boolean |
isPause() |
boolean |
isRunning()
means SimulationTime is started, not stopped and simulationEnd inn't reached.
|
void |
pause()
lets pause SimulationTime
|
void |
setSimulationTime(long time)
set simulation-time
|
void |
setSpeed(double speed)
updates simulation-speed
|
void |
start()
starts SimulationTime running by start-time
|
void |
stop()
stops SimulationTime
|
public static final int SHOW_DATE
public static final int SHOW_TIME
public static final int SHOW_MILLIS
public static final int SHOW_DATE_TIME
public static final int SHOW_DATE_TIME_MILLIS
public static final int SHOW_TIME_MILLIS
public static final int SHOW_DAY
public static final int SHOW_DST
public static final int SHOW_TIMEZONE
public static final int SHOW_DAY_DATE_TIME_MILLIS_DST
public SimulationTime(long start, long end, double speed, java.util.TimeZone timezone, java.util.Locale locale)
start
- start-timeend
- end-timespeed
- SimulationTime runs speed times fast as natural timetimezone
- default is UTClocale
- default is Locale.ENGLISHpublic static java.lang.String getTimeString(long time, int format)
time
- internal time as longformat
- timeformat for outputpublic static java.lang.String getTimeZoneString()
public void start()
public void stop()
public void pause()
public void cont()
public void setSpeed(double speed)
speed
- public double getSpeed()
public void setSimulationTime(long time)
time
- public long getSimulationTime()
public boolean isRunning()
public boolean isPause()
public long getSimulationStart()
public long getSimulationEnd()