public class Jd extends AbstractValue implements Increasing, ParameterDepending, Reloadable, EndpointConstraining
CurrentTime as a registered variable. Is meant as a convenience replacement
for the more generic CurrentTime global. Note that this class can be easily
tailored for the use of mjd. Providing a properties object which a
specifies the key KEY_BASEJD pointing to 40587 makes the jd
global produce mjd. Note that the key KEY_BASEJD points to the jd,
mjd, tjd, of Jan. 1st 1970, 0h00 GMT.| Modifier and Type | Class and Description |
|---|---|
static class |
Jd.Test
Test class.
|
PropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
protected double |
base
The private copy of the base jd as a double.
|
static double |
DEFBASEJD
The default jd of Jan.
|
static String |
DEFNAME
The name of this global (jd).
|
private static String |
DEFTIME
The name of the time global.
|
private static DecimalFormat |
df
The jd-formatter.
|
static String |
KEY_BASEJD
The key mapping to the jd of Jan.
|
static String |
KEY_TIME
The name of the latitude to use.
|
private CurrentTime |
time
The time parameter, if registered.
|
KEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWNKEY_NOINITONCREATE, POSTFIX_ALPHABET, POSTFIX_BYTES, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_MODTIME, POSTFIX_URLKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORCONFIG, KEY_CLASSKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME| Constructor and Description |
|---|
Jd(Map<String,String> define)
Constructs a new global representing julian date.
|
| Modifier and Type | Method and Description |
|---|---|
Long |
getAscendTime(Number until)
Returns the remaining time in ms.
|
static double |
getJd(Date f)
Static access for converting a date into a standard JD.
|
static double |
getJd(long ms)
Static access for converting a unix time stamp into a standard JD.
|
Number |
getValue()
Returns the actual jd as a double.
|
boolean |
isCompleted(Appointable.Constraint lim,
TargetDefinition dummy)
Returns true, if the observing program on the target is finished.
|
void |
registerParameter(Parameter curtime)
A parameter depending command should drain the necessarry information
to get valid out of a parameter value.
|
double |
rescanned(String key,
String old,
String newval)
It is not possible to rescan the time parameter name.
|
Number |
setValue(Number val)
Sets the jd.
|
get, setcreateParameter, delivers, exit, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, init, overrideDefaultName, register, setName, toStringclone, createFrom, createFrom, createFrom, createInstance, getApplet, getAsResources, getLocate, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, hasLocalURLs, initProperties, keyCreate, keyCreate, reload, setAppletaugment, augment, 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, parseObject, reload, removeProperty, requires, setObject, setProperties, setProperty, stringPropertiesequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitreloaddefaultBoolean, 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, stringPropertiesinitpublic static final String KEY_BASEJD
public static final String KEY_TIME
private static final String DEFTIME
public static final double DEFBASEJD
public static final String DEFNAME
private static final DecimalFormat df
protected double base
private CurrentTime time
public Jd(Map<String,String> define)
KEY_BASEJD to 40587 makes this
object produce mjd.public double rescanned(String key, String old, String newval)
rescanned in interface Reloadablerescanned in class AbstractParameterpublic void registerParameter(Parameter curtime)
ParameterDependingregisterParameter in interface ParameterDependingpublic Number setValue(Number val) throws UnsupportedOperationException
setValue in interface ValueUnsupportedOperationExceptionpublic Number getValue()
public static double getJd(Date f)
public static double getJd(long ms)
public Long getAscendTime(Number until)
getAscendTime in interface Increasinguntil - A Number carrying the datepublic boolean isCompleted(Appointable.Constraint lim, TargetDefinition dummy)
EndpointConstrainingisCompleted in interface EndpointConstraining