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 TimeUnitDay (24 hours).static final TimeUnitHour.static final TimeUnitMicrosecond.static final TimeUnitMillisecond.static final TimeUnitMinute.static final TimeUnitMonth (1/12 year).static final TimeUnitQuarter (1/4 year).static final TimeUnitSecond.static final TimeUnitWeek (7 days).static final TimeUnitYear (365.25 days). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PerUnitConfigKey<Unit> Returns a new config key for choosing a TimeUnit.doubleReturns the extent in seconds.static TimeUnit[]Returns a list of known TimeUnit instances.Methods inherited from class 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
-