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
Unit implementations representing time intervals measured in seconds.
- Since:
- 11 Jan 2018
- Author:
- Mark Taylor
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final TimeUnit
Day (24 hours).static final TimeUnit
Hour.static final TimeUnit
Microsecond.static final TimeUnit
Millisecond.static final TimeUnit
Minute.static final TimeUnit
Month (1/12 year).static final TimeUnit
Quarter (1/4 year).static final TimeUnit
Second.static final TimeUnit
Week (7 days).static final TimeUnit
Year (365.25 days). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PerUnitConfigKey<Unit>
Returns a new config key for choosing a TimeUnit.double
Returns the extent in seconds.static TimeUnit[]
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 Details
-
MICRO
Microsecond. -
MILLI
Millisecond. -
SECOND
Second. -
MINUTE
Minute. -
HOUR
Hour. -
DAY
Day (24 hours). -
WEEK
Week (7 days). -
MONTH
Month (1/12 year). -
QUARTER
Quarter (1/4 year). -
YEAR
Year (365.25 days).
-
-
Constructor Details
-
TimeUnit
public TimeUnit(String label, String textName, String symbol, double extentInSeconds, 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 Details
-
getExtentInSeconds
public double getExtentInSeconds()Returns the extent in seconds.- Returns:
- unit size in seconds
-
getKnownValues
Returns a list of known TimeUnit instances.- Returns:
- time unit options
-
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
-