# 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 final TimeUnit`
`DAY`
Day (24 hours).
`static final TimeUnit`
`HOUR`
Hour.
`static final TimeUnit`
`MICRO`
Microsecond.
`static final TimeUnit`
`MILLI`
Millisecond.
`static final TimeUnit`
`MINUTE`
Minute.
`static final TimeUnit`
`MONTH`
Month (1/12 year).
`static final TimeUnit`
`QUARTER`
Quarter (1/4 year).
`static final TimeUnit`
`SECOND`
Second.
`static final TimeUnit`
`WEEK`
Week (7 days).
`static final TimeUnit`
`YEAR`
Year (365.25 days).

### Fields inherited from class Unit

`UNIT`

## Constructor Summary

Constructors
Constructor
Description
`TimeUnit(String label, String textName, String symbol, double extentInSeconds, String description)`
Constructor.

## Method Summary

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 Unit

`equals, getDescription, getExtent, getLabel, getSymbol, getTextName, hashCode, toString`

### Methods inherited from class Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Field Details

### 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 Details

### TimeUnit

public TimeUnit(String label, String textName, String symbol, double extentInSeconds, String description)
Constructor.

Parameters:
  `label` - text to appear in a selection interface
  `textName` - text to appear in user-directed descriptive text
  `symbol` - text to appear as unit metadata, preferably compatible with the VOUnit standard
  `extentInSeconds` - extent in units of seconds
  `description` - descriptive text for XML documentation

## Method Details

### 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