Package uk.ac.starlink.ttools.plot2.geom
Class TimeUnit
- java.lang.Object
-
- uk.ac.starlink.ttools.plot2.layer.Unit
-
- uk.ac.starlink.ttools.plot2.geom.TimeUnit
-
public class TimeUnit extends Unit
Unit implementations representing time intervals measured in seconds.- Since:
- 11 Jan 2018
- Author:
- Mark Taylor
-
-
Field Summary
Fields Modifier and Type Field Description static TimeUnit
DAY
Day (24 hours).static TimeUnit
HOUR
Hour.static TimeUnit
MICRO
Microsecond.static TimeUnit
MILLI
Millisecond.static TimeUnit
MINUTE
Minute.static TimeUnit
MONTH
Month (1/12 year).static TimeUnit
QUARTER
Quarter (1/4 year).static TimeUnit
SECOND
Second.static TimeUnit
WEEK
Week (7 days).static TimeUnit
YEAR
Year (365.25 days).
-
Constructor Summary
Constructors Constructor Description TimeUnit(java.lang.String label, java.lang.String textName, java.lang.String symbol, double extentInSeconds, java.lang.String description)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PerUnitConfigKey<Unit>
createHistogramConfigKey()
Returns a new config key for choosing a TimeUnit.double
getExtentInSeconds()
Returns the extent in seconds.static TimeUnit[]
getKnownValues()
Returns a list of known TimeUnit instances.-
Methods inherited from class uk.ac.starlink.ttools.plot2.layer.Unit
equals, getDescription, getExtent, getLabel, getSymbol, getTextName, hashCode, toString
-
-
-
-
Field Detail
-
MICRO
public static final TimeUnit MICRO
Microsecond.
-
MILLI
public static final TimeUnit MILLI
Millisecond.
-
SECOND
public static final TimeUnit SECOND
Second.
-
MINUTE
public static final TimeUnit MINUTE
Minute.
-
HOUR
public static final TimeUnit HOUR
Hour.
-
DAY
public static final TimeUnit DAY
Day (24 hours).
-
WEEK
public static final TimeUnit WEEK
Week (7 days).
-
MONTH
public static final TimeUnit MONTH
Month (1/12 year).
-
QUARTER
public static final TimeUnit QUARTER
Quarter (1/4 year).
-
YEAR
public static final TimeUnit YEAR
Year (365.25 days).
-
-
Constructor Detail
-
TimeUnit
public TimeUnit(java.lang.String label, java.lang.String textName, java.lang.String symbol, double extentInSeconds, java.lang.String description)
Constructor.- Parameters:
label
- text to appear in a selection interfacetextName
- text to appear in user-directed descriptive textsymbol
- text to appear as unit metadata, preferably compatible with the VOUnit standardextentInSeconds
- extent in units of secondsdescription
- descriptive text for XML documentation
-
-
Method Detail
-
getExtentInSeconds
public double getExtentInSeconds()
Returns the extent in seconds.- Returns:
- unit size in seconds
-
getKnownValues
public static TimeUnit[] getKnownValues()
Returns a list of known TimeUnit instances.- Returns:
- time unit options
-
createHistogramConfigKey
public static PerUnitConfigKey<Unit> createHistogramConfigKey()
Returns a new config key for choosing a TimeUnit. It is suitable for use with histogram-like plots in which the horizontal axis represents time.- Returns:
- time unit config key
-
-