|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectutil.PropertyContainer
util.PropertyResources
util.PropertyBundles
stella.parameter.AbstractParameter
stella.parameter.AbstractValue
stella.parameter.AbstractTime
stella.parameter.Time
stella.parameter.SettableTime
public class SettableTime
A general variable representing time. This time is settable and advancable, making it useful for simulators that want to mimic different times.
This class uses a dirty trick. By implementing the
WeatherDependingParameter interface, we get a hold of the weather
station that will be notified in case of time advances, if it supports
this.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class util.PropertyResources |
|---|
PropertyResources.URLResource |
| Field Summary | |
|---|---|
private static DateFormat |
DEFDATEFORMAT
The default date formatter. |
private long |
faketime
The time that should be faked. |
static String |
KEY_DATEFORMAT
The key mapping to the date format to use. |
static String |
KEY_DUSKSTART
If present, only the day is deduced from offset, time from twilight. |
static String |
KEY_OFFSET
The key mapping to the starting time offset of the accelerated time. |
static String |
KEY_TIMEZONE
The key mapping to the time zone format to use. |
private Longitude |
lambda
For twilight fakes, this is the longitude. |
static String |
OFFSETSYSPROP
If acceleration is set, we export to the system properties. |
private Latitude |
phi
For twilight fakes, this is the latitude. |
private SimulatorWeather |
simul
A weather station based on time. |
| Fields inherited from class stella.parameter.Time |
|---|
DEFNAME |
| Fields inherited from class stella.parameter.AbstractTime |
|---|
ISO, ISOSTANDARD, UTC |
| Fields inherited from class stella.parameter.AbstractParameter |
|---|
KEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWN |
| Fields inherited from class util.PropertyBundles |
|---|
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES |
| Fields inherited from class util.PropertyResources |
|---|
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset |
| Fields inherited from class util.PropertyContainer |
|---|
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR |
| Fields inherited from interface util.PropertySupplying |
|---|
CONFIG, KEY_CLASS |
| Fields inherited from interface util.ResourceSupplying |
|---|
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME |
| Constructor Summary | |
|---|---|
SettableTime(Map<String,String> prop)
Constructs a new global representing a faked time. |
|
| Method Summary | |
|---|---|
void |
advance(long add)
Advances the time for the stated amount of milliseconds. |
void |
afterAll()
For twilight times we are only ready once we have longitude and latitude. |
Object |
getForWeather(WeatherSurveying weather)
Dummy method. |
Number |
getValue()
Returns the time as an Long object. |
void |
registerParameter(Parameter p)
If parameter is a latitude, we keep it. |
void |
registerWeather(WeatherSurveying weather)
Registers the weather surveyor. |
double |
rescanned(String key,
String old,
String newval)
If offset or date format change, we act. |
Object |
set(Object date)
Links the Parameter.set(java.lang.Object) to the setDate(java.lang.String) method. |
void |
setDate(Date fake)
Sets a fake date. |
boolean |
setDate(String fake)
Sets the fake time to the date represented by the argument string. |
private void |
setFakeTime(long ms)
|
void |
setJd(double jd)
Sets a JD. |
| Methods inherited from class stella.parameter.Time |
|---|
getAscendTime, getTime |
| Methods inherited from class stella.parameter.AbstractTime |
|---|
getFormatted, setValue |
| Methods inherited from class stella.parameter.AbstractValue |
|---|
get |
| Methods inherited from class stella.parameter.AbstractParameter |
|---|
createParameter, delivers, exit, getFormatted, getName, getPreserveFile, getString, getString, init, register, setName, toString |
| Methods inherited from class util.PropertyBundles |
|---|
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource |
| Methods inherited from class util.PropertyResources |
|---|
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet |
| Methods inherited from class util.PropertyContainer |
|---|
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, setObject, setProperties, setProperty, stringProperties |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface stella.Parameter |
|---|
get, getFormatted, getName, getString |
| Methods inherited from interface util.PropertySupplying |
|---|
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties |
| Methods inherited from interface util.Initializable |
|---|
init |
| Methods inherited from interface util.Reloadable |
|---|
reload |
| Methods inherited from interface util.ResourceSupplying |
|---|
getResource, getResourceAsStream, getResources |
| Field Detail |
|---|
public static final String KEY_OFFSET
public static final String KEY_DUSKSTART
public static final String KEY_DATEFORMAT
public static final String KEY_TIMEZONE
private static final DateFormat DEFDATEFORMAT
public static final String OFFSETSYSPROP
private long faketime
private SimulatorWeather simul
private Longitude lambda
private Latitude phi
| Constructor Detail |
|---|
public SettableTime(Map<String,String> prop)
| Method Detail |
|---|
public void afterAll()
afterAll in interface AfterRegisteringpublic void registerParameter(Parameter p)
registerParameter in interface ParameterDepending
public double rescanned(String key,
String old,
String newval)
rescanned in interface Reloadablerescanned in class AbstractTimepublic Object set(Object date)
Parameter.set(java.lang.Object) to the setDate(java.lang.String) method.
set in interface Parameterset in class AbstractValuepublic void registerWeather(WeatherSurveying weather)
SimulatorWeather, we
keep a reference for possible time advances.
registerWeather in interface WeatherDependingParameterpublic Object getForWeather(WeatherSurveying weather)
registerWeather(stella.sensor.WeatherSurveying) method.
getForWeather in interface WeatherDependingParameterAbstractValue.get()public boolean setDate(String fake)
public void setDate(Date fake)
public void setJd(double jd)
private void setFakeTime(long ms)
public void advance(long add)
public Number getValue()
setDate(java.lang.String) or advanced, using
advance(long).
getValue in interface ValuegetValue in class Time
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||