|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.convert.Iso8601Converter
public abstract class Iso8601Converter
Converts between Strings in ISO-8601 format and some kind of numeric date.
Nested Class Summary | |
---|---|
protected static class |
Iso8601Converter.DateKit
Helper class which contains all the items which are potentially expensive to produce but cannot be shared by different threads. |
Constructor Summary | |
---|---|
protected |
Iso8601Converter(uk.ac.starlink.table.ValueInfo isoInfo,
uk.ac.starlink.table.ValueInfo numInfo)
Constructor. |
Method Summary | |
---|---|
Object |
convert(Object in)
Performs a conversion from the input type to the output type. |
protected static double |
dateToMjd(int year,
int month,
int day,
int hour,
int min,
double sec)
Converts a calendar date and time to Modified Julian Date. |
protected abstract double |
fromMjd(double mjd)
Converts from Modified Julian Date to this converter's public date. |
uk.ac.starlink.table.ValueInfo |
getInputInfo()
Returns metadata describing the values on the input end of the conversion. |
protected static Iso8601Converter.DateKit |
getKit()
Returns a date kit private to the calling thread. |
uk.ac.starlink.table.ValueInfo |
getOutputInfo()
Returns metadata describing the values on the output end of the conversion. |
static long |
mjdToUnixMillis(double mjd)
Converts from modified Julian date to milliseconds since the Unix epoch (1970-01-01T00:00:00). |
protected abstract double |
toMjd(double number)
Converts from this converter's public date value to Modified Julian Date. |
Object |
unconvert(Object out)
Performs a reverse conversion, from the output type to the input type. |
protected static double |
unixMillisToMjd(long unixMillis)
Converts from milliseconds since the Unix epoch (1970-01-01T00:00:00) to a modified Julian date value |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected Iso8601Converter(uk.ac.starlink.table.ValueInfo isoInfo, uk.ac.starlink.table.ValueInfo numInfo)
isoInfo
- input value metadata (describing ISO-8601 strings)numInfo
- output value metadata (describing numeric date)Method Detail |
---|
public uk.ac.starlink.table.ValueInfo getInputInfo()
ValueConverter
getInputInfo
in interface ValueConverter
public uk.ac.starlink.table.ValueInfo getOutputInfo()
ValueConverter
getOutputInfo
in interface ValueConverter
public Object convert(Object in)
ValueConverter
convert
in interface ValueConverter
in
- object of input type
public Object unconvert(Object out)
ValueConverter
unconvert
in interface ValueConverter
out
- object of output type
protected abstract double toMjd(double number)
number
- date value
protected abstract double fromMjd(double mjd)
mjd
- date as MJD
protected static double dateToMjd(int year, int month, int day, int hour, int min, double sec)
year
- year ADmonth
- index of month; January is 1, December is 12day
- day of month (the first day is 1)hour
- hour (0-23)min
- minute (0-59)sec
- second (0<=sec<60)
protected static double unixMillisToMjd(long unixMillis)
unixMillis
- milliseconds since the Unix epoch
public static long mjdToUnixMillis(double mjd)
mjd
- modified Julian date
protected static Iso8601Converter.DateKit getKit()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |