stella.parameter
Class DateFromJd

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by stella.parameter.AbstractParameter
                  extended by stella.parameter.DateFromJd
All Implemented Interfaces:
Cloneable, Parameter, ParameterDepending, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying

public class DateFromJd
extends AbstractParameter
implements ParameterDepending

Converts a julian date into a human-readable date, formatted in ISO style. Can also be used to convert any number into a 'date', if the properties KEY_JD is set explicately.


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private static DateFormat DEFDATEFORMAT
          The default date formatter.
private  Value jd
          The value of the jd.
static String KEY_DATEFORMAT
          The key mapping to the date format to use.
static String KEY_JD
          The name of the parameter that gives the julian date.
static String KEY_TIMEZONE
          The key mapping to the time zone format to use.
 
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
DateFromJd(Map<String,String> prop)
          Constructs a new date from jd object, that parses it's jd to full Time.ISO on default.
 
Method Summary
 Object get()
          Formats the jd to a date object.
 String getFormatted()
          Returns the time as a formatted date/time string.
 void registerParameter(Parameter what)
          Registers the parameters giving the ra, dec of two points.
 double rescanned(String key, String old, String newval)
          If offset or date format change, we act.
 Object set(Object val)
          Sets the sum.
 
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 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.ResourceSupplying
getResource, getResourceAsStream, getResources
 

Field Detail

KEY_JD

public static final String KEY_JD
The name of the parameter that gives the julian date.

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

KEY_TIMEZONE

public static final String KEY_TIMEZONE
The key mapping to the time zone format to use.

See Also:
Constant Field Values

DEFDATEFORMAT

private static final DateFormat DEFDATEFORMAT
The default date formatter.


jd

private Value jd
The value of the jd.

Constructor Detail

DateFromJd

public DateFromJd(Map<String,String> prop)
Constructs a new date from jd object, that parses it's jd to full Time.ISO on default. If this is unwanted, set the date format, and maybe also the timezone.

Method Detail

rescanned

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

Overrides:
rescanned in class AbstractParameter

registerParameter

public void registerParameter(Parameter what)
Registers the parameters giving the ra, dec of two points. No checks for types are made, only the parameter name counts.

Specified by:
registerParameter in interface ParameterDepending

set

public Object set(Object val)
           throws UnsupportedOperationException
Sets the sum. This is a read-only variable, therefore this method throws an UnsupportedOperationException.

Specified by:
set in interface Parameter
Returns:
The previous value of this parameter.
Throws:
UnsupportedOperationException - If this parameter is read-only.

get

public Object get()
Formats the jd to a date object.

Specified by:
get in interface Parameter

getFormatted

public String getFormatted()
Returns the time as a formatted date/time string.

Specified by:
getFormatted in interface Parameter
Overrides:
getFormatted in class AbstractParameter