|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.table.TimeDomain
public abstract class TimeDomain
Domain representing epoch values in a common time scale. The uniform conversion target for time values is doubles giving the number of seconds since the Unix epoch (1970-01-01T00:00:00). The time scale is generally assumed to be UTC, though conversions may not always be performed, for instance for values in which the intended time scale is not obvious.
A java (IEEE 754) double has 52+1 bits of precision, which I make 52*ln(2)/ln(10)=15.65 decimal places, and a year contains 3.15e7 seconds, which gives you the following precisions:
Field Summary | |
---|---|
static TimeDomain |
DECIMAL_YEAR
Domain for numeric values in decimal year (since 0 AD). |
static TimeDomain |
ISO_8601
Domain for ISO-8601 strings. |
static TimeDomain |
MJD
Domain for numeric values in Modified Julian Date. |
static TimeDomain |
UNIX_SECONDS
Domain for numeric values (already) in unix seconds. |
Constructor Summary | |
---|---|
protected |
TimeDomain(String name,
String description)
Constructor. |
Method Summary | |
---|---|
String |
getDescription()
|
String |
getName()
|
static TimeDomain[] |
getNumericTimeDomains()
Returns a selection of time domain instances suitable for use with numeric input values. |
abstract double |
toUnixSeconds(Object value)
Returns the time since the Unix epoch represented by a value in this domain. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface uk.ac.starlink.table.ValueDomain |
---|
getValueClass |
Field Detail |
---|
public static final TimeDomain DECIMAL_YEAR
public static final TimeDomain MJD
public static final TimeDomain UNIX_SECONDS
public static final TimeDomain ISO_8601
Constructor Detail |
---|
protected TimeDomain(String name, String description)
name
- domain namedescription
- domain descriptinoMethod Detail |
---|
public String getName()
getName
in interface ValueDomain
public String getDescription()
getDescription
in interface ValueDomain
public abstract double toUnixSeconds(Object value)
value
- object value
public static TimeDomain[] getNumericTimeDomains()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |