Modifier and Type | Field and Description |
---|---|
static TimeFormat |
DECIMAL_YEAR
Time format for year decimal year.
|
static TimeFormat |
ISO8601
Time format for ISO-8601 dates.
|
static TimeFormat |
MJD
Time format for Modified Julian Date.
|
static TimeFormat |
UNIX_SECONDS
Time format for seconds since the Unix epoch.
|
Modifier | Constructor and Description |
---|---|
protected |
TimeFormat(String name,
String description)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static double |
decimalYearToUnixSeconds(double decYear)
Converts decimal years to unix seconds.
|
abstract String |
formatTime(double unixSec,
double secPrecision)
Formats a time value to a given precision.
|
String |
getFormatDescription()
Returns a short description of this format.
|
String |
getFormatName()
Returns the name of this format.
|
static TimeFormat[] |
getKnownFormats()
Returns a list of all the known implementations of this class.
|
abstract Ticker |
getTicker()
Returns an object for generating ticks to label the time axis.
|
abstract double |
parseTime(String timeStr)
Turns a formatted time string into the equivalent value in
unix seconds.
|
String |
toString() |
static double |
unixSecondsToDecimalYear(double unixSec)
Converts unix seconds to decimal year.
|
public static final TimeFormat ISO8601
public static final TimeFormat DECIMAL_YEAR
public static final TimeFormat MJD
public static final TimeFormat UNIX_SECONDS
public abstract String formatTime(double unixSec, double secPrecision)
unixSec
- time value in unix secondssecPrecision
- precision of formatted string in secondspublic abstract double parseTime(String timeStr)
formatTime
.timeStr
- formatted time valueNumberFormatException
- if timeStr cannot be parsed to a time
in this formatpublic abstract Ticker getTicker()
public String getFormatName()
public String getFormatDescription()
public static TimeFormat[] getKnownFormats()
public static double unixSecondsToDecimalYear(double unixSec)
unixSec
- seconds since the Unix epochpublic static double decimalYearToUnixSeconds(double decYear)
decYear
- years since 0 ADCopyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.