stella.parameter
Class AcceleratedJd

java.lang.Object
  extended by util.PropertyContainer
      extended by stella.parameter.AbstractParameter
          extended by stella.parameter.AbstractValue
              extended by stella.parameter.Jd
                  extended by stella.parameter.AcceleratedJd
All Implemented Interfaces:
Cloneable, Parameter, Increasing, ParameterDepending, Value, ExitCleaning, Initializable, PropertyBearing, Reloadable

public class AcceleratedJd
extends Jd

Represents the current time as julian date. Does not need the Time as a registered variable. Is meant as a convenience replacement for the more generic Time global. Note that this class can be easily tailored for the use of mjd. Providing a properties object which a specifies the key Jd.KEY_BASEJD pointing to 40587 makes the jd global produce mjd. Note that the key Jd.KEY_BASEJD points to the jd, mjd, tjd, of Jan. 1st 1970, 0h00 GMT.


Nested Class Summary
 
Nested classes/interfaces inherited from class stella.parameter.Jd
Jd.Test
 
Nested classes/interfaces inherited from class util.PropertyContainer
PropertyContainer.URLResource
 
Field Summary
private  long accel
          The date when the acceleration starts.
private static double DEFACCELERATE
          The default jd of Jan.
private static DateFormat DEFDATEFORMAT
          The default date formatter.
static String KEY_ACCELERATE
          The key mapping to the jd of Jan.
static String KEY_DATEFORMAT
          The key mapping to the date format to use.
static String KEY_OFFSET
          The key mapping to the starting time offset of the accelerated time.
private  long offset
          The offset date, parsed from the offset given.
 
Fields inherited from class stella.parameter.Jd
base, DEFBASEJD, DEFNAME, KEY_BASEJD, KEY_TIME
 
Fields inherited from class stella.parameter.AbstractParameter
KEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWN
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR, KEY_NOINITONCREATE, KEY_RESOURCEBUNDLES
 
Fields inherited from interface util.PropertyBearing
CONFIG, KEY_CLASS, KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Constructor Summary
AcceleratedJd(Map define)
          Constructs a new global representing julian date.
 
Method Summary
 Number getValue()
          Returns the actual jd as a double.
 double rescanned(String key, String old, String newval)
          If offset or date format change, we act.
 
Methods inherited from class stella.parameter.Jd
getAscendTime, getJd, getJd, registerParameter, setValue
 
Methods inherited from class stella.parameter.AbstractValue
get, set
 
Methods inherited from class stella.parameter.AbstractParameter
createParameter, delivers, exit, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, init, register, setName, toString
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, clone, createFrom, createFrom, createFrom, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getLocalClassLoader, getLocalized, getLocalized, getLocalizedString, getLocalizedString, getProperties, getPropertiesToKey, getPropertiesToKey, getProperty, getResource, getResourceAsStream, getResourceFromKey, getResources, has, isNew, keyCreate, keyCreate, parseObject, reload, 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 util.Reloadable
reload
 
Methods inherited from interface stella.Parameter
getFormatted, getName, getString
 
Methods inherited from interface util.PropertyBearing
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getLocalized, getProperties, getProperty, getResource, getResourceAsStream, getResources, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 
Methods inherited from interface util.Initializable
init
 

Field Detail

KEY_ACCELERATE

public static final String KEY_ACCELERATE
The key mapping to the jd of Jan. 1st 1970, 0h00 GMT.

See Also:
Constant Field Values

KEY_OFFSET

public static final String KEY_OFFSET
The key mapping to the starting time offset of the accelerated time.

See Also:
Constant Field Values

KEY_DATEFORMAT

public static final String KEY_DATEFORMAT
The key mapping to the date format to use.

See Also:
Constant Field Values

DEFACCELERATE

private static final double DEFACCELERATE
The default jd of Jan. 1st 1970, 0h00 GMT. (2440587.5)

See Also:
Constant Field Values

DEFDATEFORMAT

private static final DateFormat DEFDATEFORMAT
The default date formatter.


accel

private long accel
The date when the acceleration starts. Identical to creation time.


offset

private long offset
The offset date, parsed from the offset given.

Constructor Detail

AcceleratedJd

public AcceleratedJd(Map define)
Constructs a new global representing julian date. Providing a properties object that maps the Jd.KEY_BASEJD to 40587 makes this object produce mjd.

Method Detail

rescanned

public double rescanned(String key,
                        String old,
                        String newval)
If offset or date format change, we act.

Specified by:
rescanned in interface Reloadable
Overrides:
rescanned in class Jd

getValue

public Number getValue()
Returns the actual jd as a double. The precision should reach ms.

Specified by:
getValue in interface Value
Overrides:
getValue in class Jd